我可能会遗漏一些明显的东西,但我不知道为什么以下Perl创建了一个数组引用grep,但没有sort或另一个通用引用?
print @$arr; # no output
print ref $arr; # no output
print scalar @$arr; # no output
print ref $arr; # no output
print sort @$arr; # no output
print ref $arr; # no output
print grep { 0 } @$arr; # no output
print ref $arr; # ARRAY
Run Code Online (Sandbox Code Playgroud)
我可能错过了一些明显的东西,或者它可能只是其中之一,但它让我难过,我想知道是否有人知道答案......
我已经在Perl 5.8和5.10上对此进行了测试,并在两者上都获得了相同的行为.
perl ×1