debugger for hash variable

require Data::Dumper; print STDERR “Line ” . __LINE__ . “, File: ” . __FILE__ . “\n” .
Data::Dumper->new([$columns, \@fields],[qw(columns fields)])->Indent(1)->Useqq(1)->Dump;

require Data::Dumper;
print STDERR “Line” . __LINE__ . “, File: ” . __FILE__ .
Data::Dumper->new([$applConfigHash],[qw(columns)])->Indent(1)->Useqq(1)->Dump;

Cached queries with bind variables. Here an Example:

my %attr = ( PrintError => 0, RaiseError => 0 );
my $dbh=DBI->connect(”dbi:mysql:$db:$server”, $usr, $pwd, \%attr)
 or do { warn “Cannot connect to $db:$server;  trying another method” };
# The SQL contains a question mark to indicate a bind variable.
$sth=$dbh->prepare( "
            SELECT name, location
            FROM megaliths
            WHERE name = ?
            AND mapref = ?
            AND type LIKE ? " );
$sth->bind_param( 1, "Avebury" );
$sth->bind_param( 2, $mapreference );
$sth->bind_param( 3, "%Stone Circle%" );
$sth->execute();
while (my $row=$sth->fetchrow_arrayref) {
     print join("t",@$row),"n";
}
$dbh->disconnect;

Leave a Reply

Your email address will not be published. Required fields are marked *

*