输出应该是aaabbbcccdddeee,而不是aaa555234dddeee
perl -wle' map { for (my $i =2; $i <5; $i++) { push @a,$_ } } "a".."e"; print @a ' aaa555234dddeee
仅在引用/解除引用$_变量时的预期行为,
perl -wle' map { for (my $i =2; $i <5; $i++) { push @a,${\$_} } } "a".."e"; print @a ' aaabbbcccdddeee
解决方法
在我看来,这是上个月报道的一个错误的例子(但已经存在了12年):
https://rt.perl.org/Public/Bug/Display.html?id=123285
它是固定的但我不相信任何已发布的版本.