Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Background (not a mandatory read)

I started my current job as a web development intern. The guy who was teaching me left half way through and I have basically been left up sh*t creek with only a Google paddle since there is almost no documentation on how to run any of the servers. Instead of developing, I now mainly maintain the software on the servers including the company Intranet.

Situation

Im used to working with Python, but we currently have a Development Intranet which is down and seems to run on, or at least is started by, Perl scripts. The server is running Solaris 10

Im trying to run a .pl file but the system complains that it cannot find LWP/Simple.pm

LWP/Simple.pm is there, but its under a different Perl version.

perl/lib/site_perl/5.6.1/LWP/Simple.pm

But the current version is:

@INC:

/usr/perl5/5.8.4/lib/sun4-solaris-64int
/usr/perl5/5.8.4/lib
/usr/perl5/site_perl/5.8.4/sun4-solaris-64int
/usr/perl5/site_perl/5.8.4
/usr/perl5/site_perl
/usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int
/usr/perl5/vendor_perl/5.8.4
/usr/perl5/vendor_perl

bash-3.00# perl -V

Summary of my perl5 (revision 5 version 8 subversion 4)

I am very reluctant to install anything new, as this MUST have been started before, so everything should be in place. I just need to understand how all of this works. Is @INC like LD_LIBRARY_PATH?

How would you switch the current version? Is there something for Perl which is like virtualenv?

Ive had a go at declaring the Perl version, but that just gives the same error message:

perl/bin/perl5.6.1 bin/emwd.pl

The actual error is:

Can't locate LWP/Simple.pm in @INC (@INC contains: /ade_autofs/ade/perl/bin/Solaris/Opt/lib/5.6.1/sun4-solaris /ade_autofs/ade/perl/bin/Solaris/Opt/lib/5.6.1 /ade_autofs/ade/perl/bin/Solaris/Opt/lib/site_perl/5.6.1/sun4-solaris /ade_autofs/ade/perl/bin/Solaris/Opt/lib/site_perl/5.6.1 /ade_autofs/ade/perl/bin/Solaris/Opt/lib/site_perl .) at bin/emwd.pl line 173. BEGIN failed--compilation aborted at bin/emwd.pl line 173.

Seems straight forward, but Im not sure I should be changing @INC

share|improve this question
    
There may be multiple versions of Perl installed. Check the install directory for binaries containing version numbers. –  Chris S Jul 27 '12 at 14:50
add comment

1 Answer 1

Two likely things here:

1) is there a perl in a different path? Maybe it's run by hand from there.

2) your "LD_LIBRARY_PATH" equivalent is PERL5LIB. Check around and see if there's anything setting that.

after you get that figured out, time to start carving yourself a better paddle :) There are lots of options including building a complete library tree under a path and then using PERL5ENV on that, or even building your own standalone perl+libraries and invoking that in all your scripts.

Oh yeah - Solaris! I suspect it's running not-your-system-perl. Check for /opt/csw/bin/perl or similar. We do that on our one Solaris host - call the csw perl for stuff we want to run, and leave the system perl alone.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.