This is my first foray into subclasses with perl, and I wonder why I get this simple error ...
"It is not possible to find the prepare method using the package" WebDB :: st "in / home / dblibs / WebDB.pm line 19. " It seems to find the WebDB module in order, but not the preparation routine in :: st
First, here is my package (both packages are in the same 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 "our @ISA = qw (;; st)" with "use the WebDB database and the same problem. I think this is probably something very simple that I'm missing. Thanks a lot! Jane