I have a perl script that is designed to connect to an MS SQL server DB. It uses DBI module.
For some reason I can execute the script from the command line and it works fine but when I put it into a Crontab it fails with this error:
DBI object version 1.627 does not match bootstrap parameter 1.643 at /usr/lib64/perl5/DynaLoader.pm line 213. BEGIN failed--compilation aborted at /usr/local/lib64/perl5/DBI.pm line 284. Compilation failed in require at /app/www/tools/GoSet/art_db_insert.pl line 5. BEGIN failed--compilation aborted at /app/www/tools/GoSet/art_db_insert.pl line 5.
I've verified that my 'which perl' matches the shebang line in the script. I also verified that if I do 'perldoc -m DBI' it shows the version 1.643. I cant figure out where it is getting the version 1.627 from or why it works from command line but not crontab.
I have other perl scripts in crontab that work fine, but this is the only one with an error (and the only one using DBI).
Any ideas?
crontab line 19 6-17 * * 1-5 cd /app/www/tools/GoSet&& perl /app/www/tools/GoSet/art_db_insert.pl > /app/www/tools/GoSet/artcron.log 2>&1
$ perl -M5.010 -e'
say "INC:"; say " $_" for @INC;
say "ENV:"; say " $_: $ENV{$_}" for sort grep /^PERL/, keys %ENV;
'
INC:
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.
ENV: