for some reason, hopefully a simple and fixable one, I can connect to the
database from a script, but when I wrtie the same code into a mod, the
$dbh is not created. The code is straight forward and the handler is
part of a <Location> directive
<Location /auth>
SetHandler "perl-script"
PerlHandler isoft::twigauth
</Location>
================
package isoft::twigauth;
use strict;
use Apache::Constants qw(:common);
use Apache::Log();
use Sybase::DBlib;
sub handler{
my $r = shift;
my $dbh = undef;
my $i;
$dbh = Sybase::DBlib->dblogin('sa','','ISOFT',"$$");
my @data = $dbh->nsql("select * from sysprocesses",[]);
for ($i=0; $i <= $#data; $i++){
$r->log->info("\n$data[$i][5]");
}
return FORBIDDEN; #just to apease the client
}
1;
When run in a script, the code executes and I get a return from the DB.
When run as a module, the dbh never gets created and the
following error occurs:
DB-Library error:
[Thu Apr 13 14:29:35 2000] [error] Can't call method "nsql" on an
undefined value at /usr/lib/perl5/site_perl/5.005/isoft/tw
igauth.pm line 16.
Is there anything I am missing?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
David Hajoglou "Hojo" --UNC Delta U. 1998--
Director of Voice and Data Communications/Linux Sys. Admin.
iSoft Corp. Phone: 1.303.539.0513 x202 Fax: .0512
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
c:\winnt> secure_nt.exe
Securing NT. Insert Linux boot disk to continue......