in reply to Re: How do I dump data to file on hard exit?
in thread How do I dump data to file on hard exit?

Please set
$SIG{INT} = 'IGNORE';
as the first thing in your handler, or else the sub will recurse the first time someone presses ctrl-C while in this sub.

And, Like you remarked yourself, you still have to actually exit or die at the of the sub, or it'll just resume where it left off, afterwards.

Replies are listed 'Best First'.
Re^3: How do I dump data to file on hard exit?
by starbuck (Novice) on Apr 03, 2006 at 11:29 UTC
    Thanks, I used the signal handlers. Also the autoflush negated the need to open and close the file each iteration.