Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Perl Version Mystery

by awohld (Hermit)
on Oct 21, 2005 at 05:39 UTC ( #501890=perlquestion: print w/ replies, xml ) Need Help??
awohld has asked for the wisdom of the Perl Monks concerning the following question:

I've been using perl on my home server for several months using this as the shebang line:

!#/usr/bin/perl

I've installed all kinds of things using CPAN without a problem. Then today I run CPAN and it tells me that a ton of environment variables are missing and I need to reconfigure it. So I do that and install HTML::TokeParser::Simple.

Then I try to run a program using HTML::TokeParser::Simple and it errors out saying it can't find it, I'm still using !#/usr/bin/perl

So I check out "whereis perl" and now I have my standard directory that I've been using for months /usr/bin/perl (v 5.8.6)and a new directory I haven't noticed before, where HTML::TokeParser::Simple is installed /usr/local/bin/perl (v 5.8.7)

The Perl 5.8.7 directory has a creation date of 10/7/2005 so it looks like a new perl has been installed. Is there a way to revert CPAN to use the old 5.8.6 perl in the /usr/bin/perl directory? How does perl update itself, this may have happened when I updated Fedora with Yum.

Update:I figured it out, I must have installed a new version of perl. The cpan I'm now running is /usr/local/bin/cpan, my old cpan is at /usr/bin/cpan. I can run the old cpan and everything works fine. I need to now find out about upgrading Perl.

Comment on Perl Version Mystery
Re: Perl Version Mystery
by Skeeve (Vicar) on Oct 21, 2005 at 06:15 UTC
    Just a sidenote: Was it just a typo or do you really use !#/usr... instead of the correct #!/usr...?

    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
      It's a typo.
Re: Perl Version Mystery
by blazar (Canon) on Oct 21, 2005 at 09:02 UTC
    It seems your perl has been already upgraded. If you want to stick with your older version of perl, if it's still on your computer, then put the full path to the actual executable in the shebang line.

    You may want to upgrade all of your modules instead, especially the binary ones, since they won't be compatible with the new perl executable any more. Then I'm sure I've seen ways to do so by means of suitable modules; only, I'm not sure which ones, but chances are that they may be Bundle::CPAN or CPANPLUS.

Re: Perl Version Mystery
by rinceWind (Monsignor) on Oct 21, 2005 at 13:50 UTC

    If you've a lot of scripts with shebangs that you need to change, you can use the standard mechanism that ships with ExtUtils::MakeMaker, which itself is part of the core:

    perl -MExtUtils::MY -e 'MY->fixin(@ARGV)' *.pl

    See my use.perl journal on the subject.

    --

    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (14)
As of 2014-08-01 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (27 votes), past polls