That's the POSIX way to do things. It's as ugly in Perl as it's in C, since in C it's also done a la POSIX. Fortunately in Perl we have Another Way To Do It:
sub interrupt { print "quitting!\n"; } $SIG{'INT'} = 'interrupt'; sleep 20; __END__ ^C quitting!
--
David Serrano
In reply to Re: Setting signal handlers
by Hue-Bond
in thread Setting signal handlers
by andyford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |