Here are a few ways to select a different module from the command line. Let's say I want to modify the behavior of
Carp, and I copied the
Carp.pm file to my local
/home/toolic/lib directory. These command lines will effectively prepend my local directory to the
@INC array, and choose my Carp over the standard module:
- perl -I/home/toolic/lib my_script.pl
- perl -Mlib=/home/toolic/lib my_script.pl
- env PERL5LIB=/home/toolic/lib my_script.pl
See also
perlrun and
env