Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Run before exit

by moritz (Cardinal)
on Jun 16, 2008 at 16:14 UTC ( [id://692299]=note: print w/replies, xml ) Need Help??


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

Yes. I didn't parse the "only" in the original question correctly. If it should really only be triggered by exit, it might be useful to override it (CORE::exit IIRC).

Replies are listed 'Best First'.
Re^3: Run before exit
by almut (Canon) on Jun 16, 2008 at 16:39 UTC
    (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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://692299]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-19 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found