I have an array of hashes (not of my making) called @Array. One way to access each hash is:
foreach (@Array) { code here }
So to print the keys of the hashes it makes sense that this should work:
foreach (@Array) {
foreach my $tmp (keys %{$Array[$_]}) {
print "$tmp\n"
}
}
However, that gives me a beautiful "Out of memory!" error. So, after looking in Programming Perl, I found out that this is what ://234940]: did you preview your post? It did not look quite right did it? There are links at the bottom of the page to instructions on how to format posts. It would have should work (and it does):
foreach (@Array) {
foreach my $tmp (keys %$_) {
print "$tmp\n"
}
}
Why in the world does "%$_" work and not the other?
thanks.
Edited by mirod 2003-02-13: fixed a typo in the title