To make debugging a bit easier, I want to print out all the keys and values of all handle attributes in DBI.
I tried:
use DBI;
use Data::Dumper;
my $db = DBI->connect(etc);
print Dumper($db);
But I only see "bless {}, 'DBI::db'" Is there a method in DBI itself or a variable I can print with Dumper(), that will print info on the internals of DBI?
The DBI docs mention in passing...
A DBI handle is a reference to a tied hash. A tied hash has an inner hash that actually holds the contents.
You can get at this internal attribute hash with tied.
print Dumper tied %$dbh;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With