You can simplify your code without sacrificing clarity like this:
If you want to use both keys and values, you still can do it with a single loop:sub foo { my $hash_ref = shift; print "$_\n" for values %$hash_ref; }
sub foo { my $hash_ref = shift; while ( my ( $key, $val ) = each %$hash_ref ) { # do something with $key and $val } }
the lowliest monk
In reply to Re: Hashes of arrays problem
by tlm
in thread Hashes of arrays problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |