11/06/08 08:22:01.07
変更を加えず参照するだけならどっちでもいいだろうけど、同値と同一は違うよ、念のため
my %test = ('123'=>'yotoshiku', '567'=>'aishite');
testfunc({%test});
print "1: ", %test, "\n";
testfunc(\%test);
print "2: ", %test, "\n";
sub testfunc {
my $hashref = shift;
$hashref->{123} = "unko";
}
__END__
Output:
1: 123yotoshiku567aishite
2: 123unko567aishite