Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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:


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.

Replies are listed 'Best First'.
Re: Perl Version Mystery
by Skeeve (Parson) 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...?

      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?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2022-01-28 02:18 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (72 votes). Check out past polls.