Article 5C9YF cron job not firing off perl script -- 'use' statements stopping it

cron job not firing off perl script -- 'use' statements stopping it

by
nachtmsk
from LinuxQuestions.org on (#5C9YF)
Hi,

I have a perl script that wasn't getting run by (root) cron.
I wrote another small script to test it and included the same 4 mods I was running in the initial script.
Apparently the script won't run if the three "use" statements I have commented out are un-commented

1. The script runs and processes correctly if I run it by hand. Permissions on the script are good. Directory permissions are good.
2. The script will run in cron if I comment out those three 'use' statements. It's fine with the DBI mod
3. I reinstalled those three mods via cpan, to make sure they were installed correctly.
4. No errors from the cron. I tried running it both from the root cron and the user 'pi' cron.

This one has me stumped.
Here is the cron and the script.

--- script --
#!/usr/bin/perl

# Used to test things.

#use LWP::Simple;
#use Data::Dumper;
#use Mojo::JSON;

use DBI;

open(LOGS, ">>/home/pi/logs/weather.log") or warn "Can't open log $! ";

print LOGS " Hello again\n";

close(LOGS);
---------

---- ROOT CRON ----
*/2 * * * * /home/pi/scripts/test.pl &>> /home/pi/logs/cron.loglatest?d=yIl2AUoC8zA latest?i=sU2-MDUkFjc:8VOg2UIzzRc:F7zBnMy latest?i=sU2-MDUkFjc:8VOg2UIzzRc:V_sGLiP latest?d=qj6IDK7rITs latest?i=sU2-MDUkFjc:8VOg2UIzzRc:gIN9vFwsU2-MDUkFjc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments