http://qs321.pair.com?node_id=1187663


in reply to Trouble finding modules from cron

The environments are probably different between your log-in and cron. Once you've identified which path is missing from the cron environment (run perl -E'say for @INC' as yourself and as cron, check the gaps for the libraries), you can either modify the scripts using lib (e.g., use lib '/usr/local/lib64/perl5';) or modify cron's environment.

There's also a possibility here of local pathing, but the solution there is essentially the same. There's also a possibility of a permissions issue (cron doesn't have read privileges for the libraries), which requires some chmoding or group-level access modification.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Trouble finding modules from cron
by cbeckley (Curate) on Apr 11, 2017 at 17:51 UTC

    Ah, I had assumed (never a good idea) that the cron user and the interactive user were the same.

    Some additional questions for faineant:

    • Are the cron and interactive users the same?
    • Is Foo/Bar.pm part of the scripts you've inherited?
    • If you have access to the old system, is PERL5LIB set?
    • What is the value of @INC on the old system vs the new system?

    Thanks,
    cbeckley

      The cron user is the same as the interactive user.
      Foo/Bar.pm is part of the script tree that I have to port.
      PERL5LIB is set on the old system but I can't figure out where.
      I'm not sure if can share @INC on a public forum

      I can't believe how much help I'm getting and how quickly!

      Thank you all so much!>

      Thanks -F