http://www.perlmonks.org?node_id=1004507


in reply to Re^5: Program unexpectedly terminates
in thread Program unexpectedly terminates

There's another case not covered: exec. Something like exec("/bin/true") will effectively exit a script without triggering any END blocks, etc.

Illustration:

#!/usr/bin/env perl use 5.010; use strict; use warnings; BEGIN { *CORE::GLOBAL::exit = sub { die("exit called") } } END { say "END block"; } do { exec "/bin/true" }; # Assuming a Unix-like system here say "got here";
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^7: Program unexpectedly terminates
by ColonelPanic (Friar) on Nov 19, 2012 at 11:13 UTC
    Thanks, I didn't realize that one.


    When's the last time you used duct tape on a duct? --Larry Wall