Elaborating: each returns a key/value pair, so you need to:
while (my ($k,$v) = each %hash)
Though in a scalar context, each returns just the key, but I think keys is more readable:
for (keys %hash)
In reply to Re^2: each function
by RonW
in thread each function
by adriang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |