Both use and require will do the job. The @INC array by default includes the
current directory, '.', as its last entry, so you can split your program
into Perl modules in the same directory. 'use' is more appropriate as it
happens at compile time (whereas 'require' pulls the file in at run time).
'
Hi Craig,
Just put it in a file with a ./pm extension in the same directory as your calling
program, then use either the use or require statements:
file: rjnWeb.pm
in my program file:
use rjnWeb;
works like a charm on my ActivePerl on Win2k and on one of the unix servers I telnet
to. It does
"Craig Williams" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I don't want to keep all my code for a script in one file.
>
> Do I have to use modules to break apart the code ? Is there anyway to just
> include a .pl file ? Modules used this way are a
> pain b
What you want is 'require'.
perldoc -f require
You should also check your books in the index for 'require' as this topic should be
covered, otherwise you might consider new books ;-)...
If you have the time you might also have a look at Find::Bin and consider developing
modules anyways...
htt
I don't want to keep all my code for a script in one file.
Do I have to use modules to break apart the code ? Is there anyway to just
include a .pl file ? Modules used this way are a
pain because they must be put into /site/lib to work ..?
I have searched google and docs and even my books on perl