|Think about Loose Coupling|
cron vs bash (solved)by dorko (Parson)
|on Jun 04, 2010 at 14:05 UTC||Need Help??|
dorko has asked for the
wisdom of the Perl Monks concerning the following question:
While not exactly a Perl question, I hope the members of the monastery will indulge me.
I've got a Perl script on a Solaris server that runs fine from an interactive command line. The script fails when run under cron. The use statements seem to succeed, because the script partially runs and does provide some correct output. The exact error message is 500 Can't locate object method "new" via package "LWP::Protocol::https::Socket" at /home/stella/reach/grades/modules/Vista/Sdk.pm line 333 I'm using LWP and HTTPS, but if Perl couldn't find the OpenSSL libraries, it would have given me a different kind of error, right?
My research leads me to believe this a problem with the environment variables not being the same in the shell vs cron. I've added code in a begin block to change the $ENV variable.
$ENV. before I change it:
$ENV. after I change it:
Now obviously I didn't bring all the environment variable over into cron, but I can't see how some of them would make a difference.
Any thoughts or suggestions? As always, thank you for your time.
-- Yeah, I'm a Delt.