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
?
我不太明白程序應該做什麼。原始代碼中沒有foreach。 –