Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by choroba (Cardinal)
on Oct 30, 2017 at 23:01 UTC ( [id://1202386]=note: print w/replies, xml ) Need Help??


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

There's no EXIT handler in Perl. You can use the END {...} block instead. Why do you need it?

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: trap signal 'exit': why I am not able to have it work??
by alex5161 (Novice) on Oct 31, 2017 at 13:00 UTC

    Sure!

    Completely cover all my needs! Just followed shell-script functionality and did not guess about the END{}

    Thanks!

      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__
        .. 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1202386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-26 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found