我可以用“strict”来观察运行时错误吗?

时间:2016-02-11 07:19:34

标签: perl

假设我有大量的perl脚本根本没有use stirct,我只想观察use strict上的运行时错误。我可以这样做吗?

#!/usr/bin/perl
use strict;

my $foo = '1';
my @bar = @{$foo};  # wrong!

print "done";

1;

STDOUT:

done

STDERR:

Can't use string ("1") as an ARRAY ref while "strict refs" in use at test.pl line 5.

0 个答案:

没有答案
相关问题