
| Contents |
|||||||||||||||
| [an error occurred while processing this directive] |
5.4.2 Each
The
use strict; my %table = qw/schmoe joe smith john simpson bart/; my($key, $value); # @cc{Declare two variables at once} while ( ($key, $value) = each(%table) ) { # @cc{Do some processing on @scalar{$key} and @scalar{$value}} }
This
So, if you need to loop and change values in the hash, use the following
use strict; my %table = qw/schmoe joe smith john simpson bart/; foreach my $key (keys %table) { # Do some processing on $key and $table{$key} } |