You can avoid the scalar op and a useless variable by just calling keys in scalar context:
I'd want to see that documented in the code or someone will get bitten!
keys %hash; # reset each to beginning of hash return "The key for 2 is $key\n" if $val == 2;
--
Murray Barton
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho
In reply to Re^2: Ouch! Each! Reentrant it is not
by greenFox
in thread Ouch! Each! Reentrant it is not
by Thilosophy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |