in reply to problem using foreach and each with hash ref
The next time you call each you'll get the next pair out of the hash.
The usual way to do what you likely want is:
foreach my $key (keys %$hash_ref) { my $value = $hash_ref->{$key}; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2:problem using foreach and each with hash ref
by vinoth.ree (Monsignor) on Aug 19, 2009 at 05:56 UTC | |
by goeb (Pilgrim) on Aug 19, 2009 at 06:06 UTC | |
by vinoth.ree (Monsignor) on Aug 19, 2009 at 06:12 UTC | |
by ikegami (Patriarch) on Aug 19, 2009 at 14:38 UTC | |
by grizzley (Chaplain) on Aug 19, 2009 at 08:11 UTC | |
by Anonymous Monk on Aug 19, 2009 at 08:56 UTC | |
| |
by tilly (Archbishop) on Aug 19, 2009 at 06:08 UTC | |
by vinoth.ree (Monsignor) on Aug 19, 2009 at 06:15 UTC |