in reply to Trouble finding modules from cron
@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.use FindBin; use lib "$FindBin::Bin/../path/to/modules";
Otherwise you could just use the path directly, although this makes me itch a little:
use lib "/full/path/to/modules";
Hope this helps.
Thanks,
cbeckley
In Section
Seekers of Perl Wisdom