in reply to Re: Run before exitin thread Run before exit
Wouldn't that be executed as well with die()?
(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; [download]
www.com | www.net | www.org
No recent polls found