Hi.
The reasons why your code snippet doesn't work have been explained (I hope to your satisfaction?).
However, if you're interested in visualising only the keys of your hash, each is not really your friend. Do this instead:
for my $key ( keys %hash ) { print $key, "\n"; }
Or, even more succinctly:
print "$_\n" for keys %hash;In reply to Re: Learning to use "each"
by Not_a_Number
in thread Learning to use "each"
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |