I tried to run a perl script inside my other shell script but I have faced the following snag:
Can’t locate new.pm in @INC (@INC contains: /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl
I have specifically set the path where the additional local perl script, i.e, "new.pm" in my Perl script (test.pl) but the error still appears. (perl -V) shows the path of my local Perl. I have further also set the the path of my "new.pm" in my profile file using the command "PERL5LIB".
However, when I run the script on a command line as:
./test.pl
it does work like a charm.
PS. The she-bang line is properly set.
PSS. Platform: linux, OS_vers=2.6.32-5-amd64
There are multiple ways to do this, but I don’t think setting the path is one of them. If "new.pm" is in the
/my/libdirectory, try any of these:or
or
or
The path tells your shell where to look for executables. The examples above all tell perl where to find libraries.