in reply to How to end "do" with Ctrl-C
You need to trap the INT signal.
our $stopit = 0; $SIG{INT} = sub { $stopit++; }; while (!$stopit) { system("netstat -an | grep $line"); sleep 10; }
90% of every Perl application is already written. ⇒ |
dragonchild |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to end "do" with Ctrl-C
by kennethk (Abbot) on Dec 02, 2008 at 23:03 UTC | |
by ikegami (Patriarch) on Dec 03, 2008 at 00:12 UTC | |
by st_possenti (Monk) on Dec 02, 2008 at 23:13 UTC |
In Section
Seekers of Perl Wisdom