Perl - Foundation

www.perl.org


perl file.pl: run .pl file
perldoc command: view help on command

cpan module_name: install module
cpan App::cpanminus: install cpanm
cpanm module_name: get, unpack, build and install modules from CPAN

.pl: perl file
.pm: perl module(package) file, usually install via cpan and place under lib folder in hierarchy folders
e.g. App::Prove::State::Result::Test will be placed in lib/App/Prove/State/Result


@INC – module search path

perl -V: view current search path

env perl5lib to add search path in @INC

Append @INC at perl file:
#!/usr/bin/perl -w
push(@INC,”/home/test”);

or

#!/usr/bin/perl -w
BEGIN{push(@INC,”/home/test”)};

or

#!/usr/bin/perl -w
use lib ‘/home/test’;