in reply to Perl app won't compile /run from cron

Perl usually gets extra module paths from the PERL5LIB environment variable rather than PATH. So that would be the first thing to look at.

Also, its possible that cron and the terminal are running as different users (and so with different file/directory permissions), or are using different versions of the perl executable. You can see where the module is being loaded from the terminal by using:

$ perl -le 'require Image::Grab; print $INC{"Image/Grab.pm"}' /some/path/lib/Image/Grab.pm
If that path isn't in the list of paths in the cron error message, that's another place to investigate.

Dave.

Replies are listed 'Best First'.
Re^2: Perl app won't compile /run from cron
by haukex (Archbishop) on May 23, 2018 at 21:52 UTC
    ... or are using different versions of the perl executable.

    Excellent points, and that reminds me of another piece of advice I've learned the hard way (a few times ;-) ): Always use absolute paths in crontab.