Try changing the equals sign to a comma in this line:
while (($k,$v) = each (%messages))Then it should work.
The each function returns a 2-element list in a list context, but just the key otherwise.
What you were doing there was assinging $v to $k (when $v was undefined), and then assinging the key to $k.
As a result, $v was never assigned a value.
In reply to Re: Weird hash behavior
by kilinrax
in thread Weird hash behavior
by RichardH
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |