use strict;
use warnings;
my %table = qw/schmoe joe smith john simpson bart/;
my $da =1;
my($key, $value); # Declare two variables at once
while ( ($key, $value) = each(%table) )
{
$table{$key} = ++$da;
}
print %table;
输出:
schmoe2smith3simpson4
我期待着到达2345...
我怎么了foreach
?