in reply to eval failure does not set $@
perl normally wouldn't display runtime errors if a subroutine doesn't do what it is supposed to do.
eval won't either.
If the routines you are running return a status, then you want to catch that status coming back from eval:
my $status = eval "3+4";
$status should be '7'. Only if the code you are executing "dies" or throws a warning, in the perl sense, would eval return something in $@.
Does that help?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: eval failure does not set $@
by haukex (Archbishop) on Jun 06, 2018 at 20:51 UTC |