in reply to Signal Handling throws Core Dump
Not sure if it's a Solaris specific thing, but I used this on Linux with perl 5.8.8 and it works fine:
use sigtrap qw(handler sig_handler INT TERM QUIT PIPE); use Switch; sub sig_handler { my($sig) = shift; print "Caught signal $sig\n"; switch($sig) { case ["INT","TERM","QUIT"] { print "Exiting"; exit(0); } case "PIPE" { print "Continuing\n"; } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Signal Handling throws Core Dump
by dsb (Chaplain) on Apr 25, 2007 at 15:50 UTC |
In Section
Seekers of Perl Wisdom