From: Johan L. <jo...@ba...> - 2001-07-11 07:08:01
|
Peter wrote: >Is there a Kill or other such event if a GUI app crashes or killed? Or >should that just be handled with %SIG it would be awfully convenient if you >could do something like: I tried a few things awhile back and the only %SIG I could get to work was this: sub trapEnd { print "\nPress Ctrl-C again to terminate program\n"; logInfo("** Killed once **"); } $SIG{INT} = "trapEnd"; But that only works if you press Ctrl-C in the DOS window (it wasn't a Win32::GUI application, Ctrl-C doesn't work in a window anyway). But if the app is killed from the Task Manager, or if the user closes the DOS window with the [X] button the program never gets to know what hit it before it's too late. AFAIK, your only chance is to eval {} the main loop to catch runtime errors and deaths. That's basically it. /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |