in reply to Perl Telnet weirdness

use strict; sub who_killed_hummingbird { print "Oho, I killed myself!"; } $SIG{INT} = \who_killed_hummingbird; kill 9, $$;

Replies are listed 'Best First'.
Re: A funny way to demo $$
by broquaint (Abbot) on Nov 11, 2002 at 19:21 UTC
    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