Why doesn’t Perl catch this exception?
my $fh;
eval { close $fh };
warn('Caught') if &@;
with an output of:
Can't use an undefined value as a symbol reference at New_test.pl line 30.
UPDATE: same output without the warn line and eval { close $fh }; is line 30.
The exception is not in eval, its on line below,
&@is wrong sequence, you meant$@UPD: Note that close can die when you have strict on and $fh is undef which i think is not normal case (an algorithm bug).