in reply to Array of Hashes
Hi, you are debugging with:
$field1 = $row->{field1}; $field2 = $row->{field2}; $field3 = $row->{f +ield3}; print "Row id is $field1, field 2 is $field2, field 3 is $field3\n";
You might like sprintf, you can skip all that assigning to temporary variables just to debug an interpolated string:
print sprintf "Row id is %s, field 2 is %s, field 3 is %s\n", @{$row}{ +qw/field1 field2 field3/};
Hope this helps!
The way forward always starts with a minimal test.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Array of Hashes
by GrandFather (Saint) on Feb 07, 2019 at 19:42 UTC | |
by 1nickt (Canon) on Feb 08, 2019 at 02:28 UTC |
In Section
Seekers of Perl Wisdom