I want the @INC to be as follows...
I would firstly create the following My_INC.pm:
package My_INC;
BEGIN {
@INC = qw(
/ajperznes/perl/localperl
/ajperznes/perl/lib/5.32.0/x86_64-linux
/ajperznes/perl/lib/5.32.0
/ajperznes/perl/lib/site_perl/5.32.0/x86_64-linux
/ajperznes/perl/lib/site_perl/5.32.0
/ajperznes/perl/lib/5.32.0/x86_64-linux
/ajperznes/perl/lib/5.32.0
);
};
1;
and place it in one of the
existing @INC directories directories currently listed in @INC. (Create such a directory if none currently exist.)
Then set the PERL5OPT environment variable to
-MMy_INC
Then, every time
perl is invoked, @INC is set as desired.
On my Windows 7 machine:
C:\>perl -le "print 'PERL5OPT: ' . $ENV{PERL5OPT}; print for @INC;"
PERL5OPT:
C:/perl-5.34.0/site/lib/MSWin32-x64-multi-thread
C:/perl-5.34.0/site/lib
C:/perl-5.34.0/lib/MSWin32-x64-multi-thread
C:/perl-5.34.0/lib
C:\>set PERL5OPT=-MMy_INC
C:\>perl -le "print 'PERL5OPT: ' . $ENV{PERL5OPT}; print for @INC;"
PERL5OPT: -MMy_INC
/ajperznes/perl/localperl
/ajperznes/perl/lib/5.32.0/x86_64-linux
/ajperznes/perl/lib/5.32.0
/ajperznes/perl/lib/site_perl/5.32.0/x86_64-linux
/ajperznes/perl/lib/site_perl/5.32.0
/ajperznes/perl/lib/5.32.0/x86_64-linux
/ajperznes/perl/lib/5.32.0
C:\>
Cheers,
Rob