How can a perl object know when it is running in an eval compared to running outside an eval?
So an object which is running something that generates a huge log. When the exception is thrown. it send a message and the catch will dump the log.
eval{ $obj->run() };if ($@) { $obj->dump(); }
And this is the way to run the object. But some people won't read the doc and simply run:
$obj->run();
and expect the script to die with a log dump if it fails.
Other than a $obj->set_verbose(); is there a way to determine if the object is running under an eval?