eval{
require $file;
}
/*subsequent code goes here*/
...
If $file contains an exit statement, the subsequent code doesn’t have a chance to run.
How to work around so that the subsequent code always get its chance to run when eval is done??
It’s not possible to abort the
exitcall.$fileshould usedieinstead, which can be trapped by aneval.As a workaround, you can override the
exitbuiltin globally: