I'm experiencing something strange with my installation of Apache::ASP
(v2.17).
In global.asa, I have this:
use vars qw($dbh);
...
sub Script_OnStart {
$dbh = DBI->connect($cfg::dsn, $cfg::user, $cfg::pass, \%cfg::attr)
or die "Could not connect to database: $DBI::errstr";
}
However, when I run my script, I get ``Can't call method "prepare" on an
undefined value'', which happens when I try to do $dbh->prepare without
$dbh = DBI->connect.
Now here's the weird part: If I "touch global.asa", everything starts
working fine! If I restart httpd, then it breaks again. I have a feeling
that it's not executing the Script_OnStart at all when it doesn't work,
because I look in the error_log, and it has this:
[Sat Sep 8 02:08:37 2001] [error] [asp] [19575] [debug] Script_OnStart
[Sat Sep 8 02:08:37 2001] [error] [asp] [19575] [debug] executing
__ASP__home_pmak_perl_web_edit_aspxINL
When it works, the error_log has this:
[Sat Sep 8 02:09:00 2001] [error] [asp] [19574] [debug] Script_OnStart
[Sat Sep 8 02:09:00 2001] [error] [asp] [19574] [debug] executing Script_OnStart
Notice that the first excerpt of the error_log does NOT have "executing
Script_OnStart". Isn't that subroutine supposed to be always executed?
Here is my httpd.conf:
PerlSetVar Global /tmp
PerlSetVar StatINC 1
PerlSetVar Debug -2
PerlSetVar NoState 1
PerlSetVar UseStrict 1
PerlSetVar PerlWarn ON
PerlSetVar MailHost localhost
PerlSetVar Global /home/pmak/perl/global
PerlSetVar XMLSubsMatch [sfh]:\w+
PerlSetVar GlobalPackage main
PerlRequire /home/pmak/perl/global/startup.pl
PerlFreshRestart On
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]