Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

perl -V using weird @INC

by dorko (Parson)
on May 25, 2005 at 14:35 UTC ( #460342=perlquestion: print w/ replies, xml ) Need Help??
dorko has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I'm stuck using a vender supplied version of Perl that works but doesn't seem to be configured correctly. A perl -v works, but perl -V complains about not finding Config.pm. Although /tmp exists, the /tmp/p561/* directories don't exist...

~/some/directory/perl/bin$ ./perl -v This is perl, v5.6.1 built for sun4-solaris Copyright 1987-2001, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.com/, the Perl Home Pa +ge. ~/some/directory/perl/bin$ ./perl -V Can't locate Config.pm in @INC (@INC contains: /tmp/p561/lib/perl5/5.6.1/sun4-solaris /tmp/p561/lib/perl5/5.6.1 /tmp/p561/lib/perl5/site_perl/5.6.1/sun4-solaris /tmp/p561/lib/perl5/site_perl/5.6.1 /tmp/p561/lib/perl5/site_perl .). BEGIN failed--compilation aborted.

A quick Google didn't show much of a solution. Am I missing some environment variables or something?

Thoughts? Comments? Questions?

Cheers,

Brent

-- Yeah, I'm a Delt.

Comment on perl -V using weird @INC
Select or Download Code
Re: perl -V using weird @INC
by robartes (Priest) on May 25, 2005 at 15:22 UTC

    Go whack your vendor over the head with a copy of the Camel. It looks as if your perl version was compiled with the /tmp/p561 directory as prefix, hence the compiled in @INC points there. Obviously, the perl binary and modules (including Config.pm) are shipped in a different directory.

    Three ways of getting around this are use lib qw(/perl/lib/directory) in your scripts, setting the PERL5LIB environment variable to the correct dir, or running perl with -I (see perlrun for that last one).

    CU
    Robartes-

      There's a fourth way: symlink from /tmp/p561 to the base installation directory (which usually is /usr, but in OP could be ~/some/directory/perl).

      Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

      Don't fool yourself.

        Of course since most OSen clean /tmp on reboot (and on some /tmp may even be in RAM) you'd want to make sure this was done at system startup time.

        Update: Heh, this is my 1337th writeup. wh00t!

      Yup, you hit the nail on the head. That's exactly what happened. They compiled Perl in the /tmp area and shipped it in another set of directories. I added export PERL5LIB=/path/to/perl/lib/perl5/5.6.1 to my .profile and it worked like a charm.

      Now, as to your other suggestion, I'm off to go find a big ol' whacking stick.

      Thanks,

      Brent

      -- Yeah, I'm a Delt.
Re: perl -V using weird @INC
by japhy (Canon) on May 25, 2005 at 15:26 UTC
    Can you find any modules? And what's Perl doing in the /tmp directory?!

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
Re: perl -V using weird @INC
by bluto (Curate) on May 25, 2005 at 16:12 UTC
    Is this really the vendor's (Sun presumably) version of Perl or has some well meaning person at your place of business built perl 5.6.1 improperly and then naively replaced the vendor's version? It's hard for me to believe a vendor would build a totally broken perl.

    Hopefully this isn't a multiuser machine, since security wise this will be a nightmare.

      It's an application vendor, not Sun. All the scripts in the application use -I to load modules... It wouldn't suprise me if they did it on purpose to keep people from using "their" copy of Perl that ships with their application.

      Cheers,

      Brent

      -- Yeah, I'm a Delt.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://460342]
Approved by holli
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-09-30 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (383 votes), past polls