saintmike has asked for the wisdom of the Perl Monks concerning the following question:
doesn't catch the error thrown by while(<>)?eval { @ARGV = qw(/nowhere); while(<>) {} }; if($@) { print "There was an error!\n"; }
The above doesn't print "There was an error!" as I'd expected, but "Can't open /nowhere: No such file or directory at ./t line 6." instead. Tested with perl 5.8.4.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: while(<>) throws uncatchable errors
by merlyn (Sage) on Jan 27, 2006 at 21:33 UTC | |
by saintmike (Vicar) on Jan 27, 2006 at 22:10 UTC |