in reply to This is a small bug in TableMatrix.pm, right??
A return inside an eval does not return from an enclosing sub. Try it!
sub eval_return { eval { return; print "This never happens.\n"; }; print "eval did not return from enclosing sub\n"; } eval_return(); __END__ eval did not return from enclosing sub
The special variable $@ (see perlvar) will always be set after the eval and indicates if the eval encountered an error or died (throwing an exception).
What's going on in the code you posted is that it's executing the things inside the eval and protecting itself from any errors that might happen inside. If there are some, it returns (return if ($@)) without doing anything else (but it also doesn't die as it would normally without the eval).
|
|---|