2006/08/24

@INC

@INC is a special Perl variable which is the equivalent of the shell's PATH variable. Whereas PATH contains a list of directories to search for executables, @INC contains a list of directories from which Perl modules and libraries can be loaded.

When you use(), require() or do() a filename or a module, Perl gets a list of directories from the @INC variable and searches them for the file it was requested to load. If the file that you want to load is not located in one of the listed directories, you have to tell Perl where to find the file. You can either provide a path relative to one of the directories in @INC, or you can provide the full path to the file.

Source: http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Description

Note: use
perl -e 'print join "\n", @INC'

to check what pathes have been defined, but it does not show the all pathes which being used.

No comments:

Post a Comment