0

I have a script and keep all external modules local so I can then package my entire script in a zip and have it work on all machines without having to install all the modules on different machines. I do:

use lib "$Bin/cpan"; 

I am trying to initiate a connection to a mysql database so I need to install DBD, DBI and mysql locally how can I do this? I tried the same way by copying the .pm files and it either gives me

DBD::mysql initialisation failed: Can't locate object method "driver" via package "DBD::mysql" at C:/Perl/lib/DBI.pm line 815.

or

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC
1
  • 2
    Are you also copying the DBD::mysql libraries (DBD/mysql/mysql.so or DBD/mysql/mysql.dll) ? Commented Jan 13, 2012 at 0:03

1 Answer 1

3

Simply transferring archives will probably not work, especially if you're transferring across operating systems or architectures (aside from simply missing files). I recommend using Carton to automate dependency management. Under the hood it uses local::lib (a brilliant module for dev and deployment in its own right) and cpanm to get the work done.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.