Next | The Perl Hardware Store | DC.pm Version | 21 |
Suppose you're using someone else's package
There's a method you wish it has, but it doesn't
For example:
my $sth = $dbh->query(...); error() unless defined $sth;
my $num_records = $sth->numrows(); for ($i=0; $i<$num_records; $i++) { # Get next record my %data = $sth->fetchhash();
# Do something with %data }
You're sick of repeating the same error-checking code
You wish that $dbh supported a myquery method
Next | Copyright © 2003 M. J. Dominus |