in reply to Re: Using foreach to process a hash
in thread Using foreach to process a hash
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using foreach to process a hash
by jdporter (Paladin) on Oct 22, 2006 at 13:27 UTC |