Try this:
#! perl -slw use strict; use 5.010; use Time::HiRes qw[ time sleep ]; $|++; $SIG{ INT } = sub { state $last = 0; if( ( time - $last ) > 2 ) { $last = time; return; } die 'Interupted by ^C^C'; }; while( 1 ) { printf "\rtum te tum: %f", time; sleep 0.1; }
In reply to Re: Force 2 'ctrl-c's to kill program
by BrowserUk
in thread Force 2 'ctrl-c's to kill program
by albob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |