melguin has asked for the wisdom of the Perl Monks concerning the following question:
So to print the keys of the hashes it makes sense that this should work:foreach (@Array) { code here }
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 %{$Array[$_]}) { print "$tmp\n" } }
Why in the world does "%$_" work and not the other?foreach (@Array) { foreach my $tmp (keys %$_) { print "$tmp\n" } }
thanks.
Edited by mirod 2003-02-13: fixed a typo in the title
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: why is AofH the way it is?
by merlyn (Sage) on Feb 12, 2003 at 21:30 UTC | |
|
Re: Why is AofH the way it is?
by runrig (Abbot) on Feb 12, 2003 at 21:29 UTC | |
by Elian (Parson) on Feb 12, 2003 at 22:18 UTC | |
|
Re: Why is AofH the way it is?
by bart (Canon) on Feb 13, 2003 at 09:30 UTC |