Subject: | fatal hides perl errors in modules |
$ cat try.pl
use strict;
use warnings;
no indirect 'fatal';
sub foo {
$bar;
}
foo $_;
1
$ perl -e 'require "try.pl"'
Indirect call of method "foo" on object "$_" at try.pl line 9.
Compilation failed in require at -e line 1.
Expected output:
$ perl try.pl
Global symbol "$bar" requires explicit package name at try.pl line 6.
Indirect call of method "foo" on object "$_" at try.pl line 9.
The error in line 6 ("Global symbol ...") is missing if the file is loaded with require/use.