I am trying to write a 'library' script where I can keep all my commonly used sub-routines for all the pages on my site.
The file is called 'lib.pl', and for example, contains a sub-routine called 'header'.
On the script that I want to call the sub-routine, I have 'required' the path to lib.pl.
From the perl script calling the routine I do this:
.
.
require '/path/to/lib.pl';
.
# print header
&header;
.
.
the 'header' script looks like:
sub header {
print qq~
#header html here
~;
}
problem: it is not working. Any idea what I am doing wrong?
The file is called 'lib.pl', and for example, contains a sub-routine called 'header'.
On the script that I want to call the sub-routine, I have 'required' the path to lib.pl.
From the perl script calling the routine I do this:
.
.
require '/path/to/lib.pl';
.
# print header
&header;
.
.
the 'header' script looks like:
sub header {
print qq~
#header html here
~;
}
problem: it is not working. Any idea what I am doing wrong?