in reply to Re: Horrible "undef local $foo;" (was: Re: Signals and 'IGNORE')
in thread Signals and 'IGNORE'

undef local $SIG{INT} is clearer in intention than local $SIG{INT}
Allow me to disagree. I do not find it more readable, instead, I find this may qualify as obfuscation. This is not Perl. Well actually, it is, but I don't think it is normal Perl.

If you insist on explicitely showing that this value is set to undef, please use a more common idiom:

local $SIG{INT} = undef;
The explicit assignment is still unnecessary, but at least it looks more harmless.
  • Comment on Re: Re: Horrible "undef local $foo;" (was: Re: Signals and 'IGNORE')
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: Horrible "undef local $foo;" (was: Re: Signals and 'IGNORE')
by shotgunefx (Parson) on Jan 07, 2003 at 09:28 UTC
    Personally, if I wanted to undef something and I was afraid it wouldn't be clear, I'd just use a comment...
    # Temporarily undef the INT signal handler local $SIG{INT};
    or such. But depending on who else is working on the code or the background, I do think that
    undef local $foo
    can be clearer sans comment.

    What I really took issue with is what I perceived as your tone towards the poster. There's been a bit of what I consider, undue rudness at the Monestary as of late. Electronic communication mediums are not always the best for deriving the "intonation" of a message and perhaps I misread the tone of your comment. Regardless, I don't think the example was a wrong answer just a differently right one.

    -Lee

    "To be civilized is to deny one's nature."