Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^6: Program unexpectedly terminates

by tobyink (Abbot)
on Nov 19, 2012 at 10:33 UTC ( #1004507=note: print w/ replies, xml ) Need Help??


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'


Comment on Re^6: Program unexpectedly terminates
Select or Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2014-07-13 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (244 votes), past polls