my %hash = ( a => 1, b => 2); while (my ($key,$val) = each %hash) { print "$key = $val\n"; } for my $key (keys %hash) { my $val = $hash{$key}; print "$key = $val\n"; }
In reply to Re: Using foreach to process a hash
by imp
in thread Using foreach to process a hash
by iridius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |