in reply to Using foreach to process a hash
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using foreach to process a hash
by ikegami (Patriarch) on Oct 22, 2006 at 21:05 UTC |