> Hi, can you please show me an example of the following signal > catching > scenario: > 1. First Ctrl-C => Just warn and wait for a key-stroke, if > any key other > then Ctrl-C is presses, continue with the program. > 2. If Ctrl-C was pressed again => Try to die gracefully, > meaning do some > cleanup before dying. > 3. If while trying to die gracefully another Ctrl-C is pressed => die > immediately
Have you read perldoc perlipc? Here is something to get you started. Do you have any code that you have tried? $SIG{INT} = sub { print "Press q if you really want to quit?"; my $q = <STDIN>; exit if ($q =~ /^q$/i); .. continue .. }; --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.737 / Virus Database: 491 - Release Date: 8/11/2004 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>