Thank you!
"list" was my disconnect. I tried the direct assignment construct multiple times, before I tried building the string and, every time Dumper out put would look like:
$VAR1 = 'Comments'; $VAR2 = ''; $VAR3 = 'InstallAddID'; $VAR4 = ''; . . .
When what I was expecting was:
Comments = ''; InstallAddID = '';
So the "X" is "%hash = ($never_gonna_work)" and the "Y" is "Why doesn't Dumper read my mind."
print Dumper(\$po); would have solved my problem.<\p>
Thanks again for the clarity. And this now works.
#!/usr/bin/perl use strict; use warnings; use diagnostics; use Data::Dumper; use DBI; my $dbargs = {AutoCommit => 0,PrintError => 1}; my $dbc = DBI->connect("dbi:SQLite:dbname=da_hrb.db","","",$dbargs); # get the default po my $sth = $dbc->prepare('select * from der_po where poid = 0'); $sth->execute; my $po = $sth->fetchrow_hashref; # corrected. thanks ikegami print Dumper($po);
In reply to Re^2: Hash assignment "odd" ness
by phigment
in thread Hash assignment "odd" ness
by phigment
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |