http://qs321.pair.com?node_id=727508


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