I consider this code buggy.
If $@ is set, it must be reported/processed
immediately without any further function call.
If you just can't
die from it, use
warn:
eval { foo() } ;
if ( $@ ) {
warn $@;
bar();
}
Undefined subroutine &main::foo called at 561955.pl line 2.
Undefined subroutine &main::bar called at 561955.pl line 5.
Note: I'm not against copying $@. If you need to make further calls first, copy it and report it later. But inadvertently clearing is a programmer's bug, not perl's fault.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
200th post