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';

In reply to Re^4: Perl version missmatch by graff
in thread Perl version missmatch by deadpickle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.