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

Re^3: Perl version missmatch

by deadpickle (Pilgrim)
on Jul 09, 2009 at 03:22 UTC ( [id://778466]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl version missmatch
in thread Perl version missmatch

Its definitely true that cron is using perl5.8.8 to execute my scripts. This is verified by the output:
root@updraft thor]# perl5.8.8 -V @INC: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8
Guess I'm going to have to do some research into why cron is using the old command perl5.8.8 and not the new one perl.

Replies are listed 'Best First'.
Re^4: Perl version missmatch
by graff (Chancellor) on Jul 09, 2009 at 03:44 UTC
    So... it must be the case that /usr/bin/perl on the machine where this cron job is running happens to be 5.8.8, because your script has /usr/bin/perl on the shebang line, and that is what cron must be running.

    Are you doing your interactive shell testing on a different machine? Or is your interactive shell environment set up such that /usr/bin/perl is somehow superseded in your PATH by a 5.10 installation? (and/or you have PERL5LIB initialized in some way that doesn't carry over into cron jobs)

    Anyway, if it's true that perl 5.10 exists somewhere on the machine where cron is running, and that the module in question has been installed for that instance of perl 5.10, and you actually want to use 5.10, and you can find the path to that instance (e.g. do type perl in your shell), then just put that path as the shebang line in the script.

    Update: actually, I'm not sure I'm convinced by the diagnostics you've shown so far. Did you really try a cron job that just did "/usr/bin/perl -V" ? If not, do that first. Then, if it really is 5.8.8, just change the shebang line to get 5.10 instead.

    If /usr/bin/perl is already 5.10, now it's a question of making sure you know where the module is, or maybe just making sure it gets installed in the "normal" way (with root permission, under /usr). If it's in some path not covered by the default @INC, and you want to use that, just add something like this to your script:

    use lib '/offbeat/path/for/misc_modules';
      I dont have type perl but which perl produced /usr/local/bin/perl which checks out ok. I added it to the shebang and the /etc/crontab PATH variable. Looks like its running ok now. Thanks for all the help.
        I don't have type perl...

        Ah. So you're using some form of csh, instead of one of the Bourne-type shells (usually bash)? Why? Don't you know csh is unhealthy, deficient and a general PITA?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://778466]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-29 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found