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 |
In reply to Re: How to end "do" with Ctrl-C
by pfaut
in thread How to end "do" with Ctrl-C
by st_possenti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |