in reply to Re: Strange SIGNAL HANDLER behavior...
in thread Strange SIGNAL HANDLER behavior...

That makes perfect sense, and is kinda what I was thinking.. But: 1) why do the Camel, Llama, and Goat all show examples like this, then? Perl Cookbook, pg 587:
$SIG{INT} = \&got_int;
..and 2) Why doesn't the hard anonymous subroutine reference also execute the subroutine immediately? Doesn't this say set $SIG{QUIT} to the value returned by sub{ GotSignal('quit'} }; ??
local $SIG{QUIT} = sub { GotSignal('quit') };
I'm just trying to make sense of Perl's internal logic here.. Maybe that's my first mistake... ;-)
"Non sequitur. Your facts are un-coordinated." - Nomad

Replies are listed 'Best First'.
Re (3): Strange SIGNAL HANDLER behavior...
by VSarkiss (Monsignor) on Oct 24, 2001 at 23:59 UTC

    The difference is that you have parens following the sub name, which parses as a subroutine call. You can't create a reference to a sub invocation with particular arguments, you can only create a reference to a sub. If you need to set values in the sub, you'll need closures.