Perl use strict "vars" 的问题
#! c:/perl/bin -w
use strict "vars";
local $newspaper = "The Times";
print "$newspaper";
请问各位大侠, 为什么上面编译时是错的呢?
Global symbol "$newspaper" requires explicit package name at testing.pl line 3.
Global symbol "$newspaper" requires explicit package name at testing.pl line 4.
testing.pl had compilation errors.
如果把local $newspaper 换成:
my $newspaper 或者 our $newspaper 都是可以正确运行的?