How use Finds Modules
How does Perl find modules?
It searches (in order) the directories in the built-in array
@INC
(pre-configured on each machine)
To view this array, enter on the command line:
perl -e "print \"@INC \n\";"
To prepend a directory to
@INC
, use the
lib
pragma:
use lib qw(../include1 include2 ../../include3);
A
pragma
is a compiler directive. There are
many
.
The current directory, ".", may be one of the elements of
@INC
Most modules end with:
1;
Why?
The method must return TRUE to indicate successful execution.
Any non-zero value would suffice.
1
is customary.