while (($key, $value) = each %hash) {You got three things wrong:
But of course, if he wants to use foreach, then for completeness it's fair to remind that he can do so, but in connection with keys, not each:
foreach my $key (keys %hash) { my $value=$hash{$key};
Update: hadn't noticed it already been covered by imp's reply. Hopefully repetita iuvant
In reply to Re^2: Using foreach to process a hash
by blazar
in thread Using foreach to process a hash
by iridius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |