in reply to Re: Re: How would you shorten this regexp conditional?
in thread How would you shorten this regexp conditional?

Except that this is in scalar context because of the scalar assignment. Had I mistakenly written my($color) = ..., then I agree I would have been burned, and rightly so.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

  • Comment on Re: Re: Re: How would you shorten this regexp conditional?

Replies are listed 'Best First'.
Re: Re: Re: Re: How would you shorten this regexp conditional?
by merlyn (Sage) on Jan 25, 2002 at 19:10 UTC
    Egad! Since when did the context of the literal slice propogate down into the right side of the slice? This is news to me. It was not that way when I invented it in Perl 3. {sigh} It must've changed in Perl5, because I'm sure I got burned by this in Perl4.

    -- Randal L. Schwartz, Perl hacker


    On further investigation, it appears that wantarray is true inside the subscript, but some sort of DWIMmery is happening. Ick!