Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^5: Program unexpectedly terminates

by ColonelPanic (Friar)
on Nov 19, 2012 at 09:56 UTC ( #1004506=note: print w/ replies, xml ) Need Help??

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

Well, your code should be catching any normal exit case. You still won't be catching exit() within an eval block, but your END statement should happen nonetheless.

I don't see any way forward other than basic debugging in order to narrow down where, exactly, this problem occurs.

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

Comment on Re^5: Program unexpectedly terminates
Re^6: Program unexpectedly terminates
by tobyink (Abbot) on Nov 19, 2012 at 10:33 UTC

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


    #!/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'
      Thanks, I didn't realize that one.

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-08-22 00:27 GMT
Find Nodes?
    Voting Booth?

    The best computer themed movie is:

    Results (144 votes), past polls