http://qs321.pair.com?node_id=877524

bradcathey has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monasterians,

It's easy enough to get the keys in a hash, but what about an array of hashes? All I really need are the keys from just one of the array elements, because the way I'm using the AoH, all the keys are the same in each element of the array.

It would look something like this:

my @AoH = ({'name' => 'Barney', 'age' => '34'},{'name' => 'Fred', 'age +' => '36'},); my %hash = $AoH[0]; print keys %hash; __OUTPUT__ name, age

Of course, that barfs. Is there a way to do this? TIA

—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot