in reply to Re: No DBI->connect_cached?
in thread No DBI->connect_cached?

Yes, I have the following in my startup.pl:
use DBI; use DBD::mysql;
And here is the exact error from the apache error log:
[Sun Sep 02 20:40:30 2007] [error] [asp] [4441] [error] Can't locate o +bject method "connect_cached" via package "DBI" at /usr/local/webtool +s/func.pm line 75. <--> , /usr/lib/perl5/site_perl/5.8.8/Apache/ASP.p +m line 1521
Here is the func.pm line 74 and 75 the asp script calls:
my $dsn = 'DBI:mysql:database=canonizer_devel_3:host=localhost;port=33 +06'; my $dbh = DBI->connect_cached($dsn, $user, $password, { RaiseError => +1, AutoCommit => $autocommit });

Replies are listed 'Best First'.
Re^3: No DBI->connect_cached?
by CountZero (Bishop) on Sep 03, 2007 at 08:43 UTC
    IIRC it is not enough to list the modules you use in startup.pl, you must still use them in your scripts itself. startup.pl just does some pre-loading only, so you save time when running your scripts.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re^3: No DBI->connect_cached?
by GrandFather (Saint) on Sep 03, 2007 at 02:57 UTC

    I wonder if there is a mismatch between the Apache::DBI version and the version DBI expects to see? From the DBI docs:

    However, if Apache::DBI is loaded then connect_cached will use it.

    DWIM is Perl's answer to Gödel