Perl语言编程不安全语法检查可用下面两个命令:
编程
#!/usr/bin/perl -w
或者:
安全
use warnings;
虽然二者均可以提示不安全的语法, 可是仍是有差异的, Perl帮助文档里面写到:
spa
The warnings pragma is a replacement for the command line flag -w, but the pragma is limited to the enclosing block, while the flag is global.code
可见前者的做用范围是全局, 然后者可由下面语句提早终结:文档
no warnings;