Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: trap signal 'exit': why I am not able to have it work??

by RonW (Parson)
on Oct 31, 2017 at 19:15 UTC ( #1202465=note: print w/replies, xml ) Need Help??


in reply to Re^2: trap signal 'exit': why I am not able to have it work??
in thread trap signal 'exit': why I am not able to have it work??

Note that END blocks are executed in the reverse order they are "registered". If you want or need your END block to run last, you need to put it before any use directives (though should be safe to put it after strict and warnings).

use strict; use warnings; my $exit_normally = 0; sub exit_handler; END { exit_handler; } # other use directives sub exit_handler { ... } ... $exit_normally = 1; __END__

Replies are listed 'Best First'.
Re^4: trap signal 'exit': why I am not able to have it work??
by alex5161 (Novice) on Nov 01, 2017 at 16:52 UTC
    .. before any use directives...
    That why I could not get the END{..} be processed by 'die' for signals...
    Thanks, again!!!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2019-05-22 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (138 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!