An example like this is also mentioned in the documentation for each. tilly already explained the reason your loop ends after the first key and value.while (($key, $value) = each %$hash_ref) { # do something... }
In reply to Re^3: What is happening ?
by goeb
in thread problem using foreach and each with hash ref
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |