this is my first foray into subclassing with perl and I am wondering why I am getting this simple error...
"Can't locate object method "prepare" via package "WebDB::st" at /home/dblibs/WebDB.pm line 19.". It seems to find the module WebDB ok, but not the prepare subroutine in ::st
First here's my package (both packages are in one file, WebDB.pm)
package WebDB;
use strict;
use DBI;
sub connect {
my $dbh = (DBI->connect ("DBI:mysql:test:127.0.0.1", "root","",
{ PrintError => 1, RaiseError => 0 }));
return bless $dbh, 'WebDB::st';
}
package WebDB::st;
our @ISA = qw(::st);
sub prepare {
my ($self, $str, @args) = @_;
$self->SUPER::prepare("/* userid:$ENV{USER} */ $str", @args);
}
1;
I also tried replacing the "our @ISA = qw(;;st)" with "use base 'WebDB'" and same problem. I'm thinking it's probably something very simple that I'm overlooking. Many thanks! Jane