- or download this
package TestModule;
require DBI;
...
bless $obj, $self;
}
- or download this
use Test::More tests => 9;
# ... snipped setup of $obj = new & etc.
...
# this fails:
isnt ($sth, undef, 'prepare creates statement handle');
- or download this
sub AUTOLOAD {
my $op = $AUTOLOAD;
...
eval "sub $op { return shift->error('Cannot autoload $op'); }"
+;
}
}
- or download this
# sets up autoload subs that 'inherit' DBI's DBH methods
sub AUTOLOAD {
...
return $self->error("Cannot autoload $op");
}
}