什么是perl中的@.
变量?
它似乎是一个特殊的,可写的全局变量,并且(出乎意料地)不会在双引号字符串中插值:
use strict;
use warnings;
# Under 5.8, 5.10, 5.12, 5.14, and 5.16,
# the following lines produce:
@. = (3, 2, 1); # no error
print "@.\n"; # "@."
print @., "\n"; # "321"
eval 'my @.; 1' # Can't use global @. in "my" at (eval 1)
or die $@; # line 1, near "my @."
我之前不记得遇到过它,并且在perlvar
和perldata
中也没有看到它。