in reply to Re: Why is to match, not to match?
in thread Why is to match, not to match?

Yes, it does, thanks! .....except for this scary bit;

print "a double matches b\n" if $a ~~ ~~$b; print "a not double matches b\n" if not $a =~ ~~~$b;

That sounds like even perl does not know what it is doing!

$a ==== $b
would never make it past the censors, and it is telling us that it just successfully parsed a "match and a half" operator there?

Replies are listed 'Best First'.
Re^3: Why is to match, not to match?
by BrowserUk (Patriarch) on Aug 28, 2009 at 19:23 UTC
    .....except for this scary bit;

    Not so scary once you realise that ~$b is bitwise-NOT of $b; and ~~$b is the bitwise-NOT of the bitwise-NOT of $b--which is just $b--and so on ad nauseum:

    c:\test>perl -E"$b = 'fred'; say for $b, ~$b, ~~$b, ~~~$b, ~~~~$b, ~~~ +~~$b" fred ÖìÜø fred ÖìÜø fred ÖìÜø
    That sounds like even perl does not know what it is doing!

    Perl knows! You just haven't been inducted into its inner circle yet:)


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.