There's more than one way to do things | |
PerlMonks |
Re: Trouble finding modules from cronby cbeckley (Curate) |
on Apr 11, 2017 at 16:41 UTC ( [id://1187662]=note: print w/replies, xml ) | Need Help?? |
@INC is where perl looks for modules. Perl populates that array from several sources, including the environment variable $PERL5LIB. Perhaps you have $PERL5LIB set in your environment? This might be what's going on since it works for you but not for cron. If that's the case, you could set the variable in the crontab entry, however, I prefer to do something like this in the calling script: This assumes your modules are reliably in the same relative location with respect to your scripts. Otherwise you could just use the path directly, although this makes me itch a little:
Hope this helps.
Thanks,
In Section
Seekers of Perl Wisdom
|
|