Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Run before exit

by almut (Canon)
on Jun 16, 2008 at 16:39 UTC ( #692302=note: print w/replies, xml ) Need Help??


in reply to Re^2: Run before exit
in thread Run before exit

(CORE::exit IIRC)

Use CORE::GLOBAL::exit() to override — CORE::exit() is the original exit builtin that you'd typically call from within your redefined exit routine...

Update: an example:

#!/usr/bin/perl BEGIN { *CORE::GLOBAL::exit = sub (;$) { print STDERR "in overridden exit(): @_\n"; CORE::exit(88); }; } exit 99;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://692302]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2018-06-23 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (125 votes). Check out past polls.

    Notices?