in reply to A funny way to demo $$
in thread Perl Telnet weirdness

Or perhaps more safely
$SIG{TERM} = sub { print "my bad\n"; exit 0; }; kill TERM, $$; __output__ my bad
As (at least on my linux system) 9 corresponds to the KILL signal which you can't trap.
HTH

_________
broquaint