in reply to Did I match or didn't I?

DELETED. This code would not only bite you in the butt, but maybe your loved ones as well.

Replies are listed 'Best First'.
Re: Re: Did I match or didn't I? (boo)
by blakem (Monsignor) on Oct 18, 2001 at 00:33 UTC
    I don't think that works.... I parse that as:
    ( my ($bar)=($foo=~m/(ello)/) ) or "default";
    which wont work on a failed match.

    -Blake

      Yea, we use || for defaults on the RHS of assignment all the time. E.g. $x= 0||5; print $x; works as expected. The || is done first, and the result of that is what gets assigned. I think he has the meanings of || and or backwards.