相关疑难解决方法(0)

为什么Perl说全局符号"SYMBOL"需要在PROGRAM.pl第X行显式包名?

我正在用Perl编写我的第一个程序,并写道:

use strict;
use warnings;
$animal = "camel";
print($animal);
Run Code Online (Sandbox Code Playgroud)

当我运行它时,我从Windows命令行获取这些消息:

Global symbol "animal" requires explicit package name at stringanimal.pl line 3
Global symbol "animal" requires explicit package name at stringanimal.pl line 4
Run Code Online (Sandbox Code Playgroud)

请问,这些消息是什么意思?

perl

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

perl ×1