sub count_rows
{ my $db = shift;
my $tablename = shift;
my $sth = $db->prepare( "select count(*) from $tablename" );
$sth->execute();
my ( $count ) = $sth->fetchrow_array();
return $count;
}
1; } |
sub debug
{ if( $::verbose ) {
print STDERR @_,"\n";
} } |
sub test_getter_setter
{ my ($object, $method, $test_val) = @_;
my $ret_val = 0;
my $old_val = $object->$method;
$object->$method($test_val);
$ret_val = (!defined($test_val) && !defined($object->$method)) ||
($object->$method eq $test_val);
$object->$method($old_val);
return $ret_val; } |