What is the use of @INC and how many methods to change it in Perl?
Deafult @INC is constructed with binaries, which can be listed using "env -i perl -V" and all thease binaries will be placed under common directory, for the binary compilation of our custom modules so we need to add the path for execution as well as compilation
below commands adds the path with @INC
To list Environmental variable PERL5LIB (or PERLLIB):perl -v
Method1:
perl -I /my/moduledir your_script.pl
Method2:
#!/usr/local/bin/perl -w -I /my/moduledir
Method3:
use lib ("/dir1", "/dir2");
Method4:
command line:
perl -Mlib=/dir1,/dir2
Method5:
Labels: perl inc, perl inc path, perl pop, perl push array into array, perl push hash into array, perl push multiple values into array, perl use lib relative path, use lib perl