I'm getting this error:
[error] Can't locate object
method "connect" via package "Apache::DBI::connect" at
/usr/local/lib/perl5/site_perl/5.6.0/i386-dynixptx/DBI.pm line 408.
One way I can avoid the error is to change startup.pl
to use DBI() instead of use Apache::DBI(). Why does that
fix it? And does it hurt anything if I don't use Apache::DBI()?
What's that for, anyway? Is Apache/DBI.pm supposed to be
the same as the other one in the perl library? (It is)
my startup.pl has this in it:
#!/usr/bin/perl
use strict;
$ENV{MOD_PERL} or die "Not running under mod_perl!";
use Apache::Registry;
use Apache::DBI ();
# Tell me more about warnings
use Carp;
$SIG{__WARN__} = \&Carp::cluck;
use CGI qw(-compile :all);
1;
and my test program is this:
#!/usr/local/bin/perl
use strict;
use Carp;
$SIG{__WARN__} = \&Carp::cluck;
use DBI;
use DBD::Oracle;
use CGI ();
my $cgi = new CGI;
print $cgi->header; my $db = DBI->connect('', 'scott', 'tiger', { } ) or die
DBI::errstr;
print "Connected!\n";