in reply to Perl Database connect not working in .pm file

Perl says that it can't find DBI.pm. Are you maybe running your script with a different version of Perl or a different environment than when you use your Perl module Marketplace.pm? The difference could be a webserver or a cron job?

Otherwise, maybe try to locate where DBI.pm is, and then find out why Perl doesn't find it in one situation:

find / -name 'DBI.pm'
perl -MDBI -wle 'print $INC{"DBI.pm"}'

Replies are listed 'Best First'.
Re^2: Perl Database connect not working in .pm file
by kanewilliam7777 (Novice) on Aug 31, 2018 at 06:20 UTC

    I have use the perl -MDBI -wle 'print $INC{"DBI.pm"}' comment. It's return the DBI.pm file location

    /home/kane/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/DBI.pm

      Your stackoverflow post says DBI is also located in /usr/local/lib/x86_64-linux-gnu/perl/5.26.1

      Can you show the code for the script that uses the module and is not working.

      poj