Hello Monks, I am working on a script that gets by DBI an hash ref inside an array ref. To get the field names of the SQL result I have to dereference the hash ref inside the array ref, so I can go thru any field name using foreach. No problem so long, I using the following code for doing that:
foreach my $head (@{$sth->{NAME_uc}}) { print $head . "\n"; }
But as I remember from the Alpaca book I mixed up two syntax styles. Each for the array ref and the hash ref. So my question now: How look the pretty code for the dereferencing in the above code?
Thanks, so long!
In reply to Dereferencing a hash ref in an array ref by Schaelle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |