CRAKRJACK has asked for the wisdom of the Perl Monks concerning the following question:
Does anybody know? This is definitely not the behaviour I expect. I could accept a syntax error, but this is just bizzre;
!~~seems equivalent to
~~... and there's more...
use 5.10.0; use strict; use warnings (FATAL => 'all'); my $a = "hello"; my $b = "hello"; print "a matches b\n" if($a ~~ $b); print "a not matches b\n" if($a !~~ $b); print "a matches not b\n" if($a ~~! $b); print "a matches and a half b\n" if($a ~~~ $b); print "a not matches and a half b\n" if($a !~~~ $b); print "a double matches b\n" if($a ~~~~ $b); print "a not double matches b\n" if($a !~~~~ $b);
This yields;
a matches b a not matches b a double matches b a not double matches b
Does anybody know why?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why is to match, not to match?
by BrowserUk (Patriarch) on Aug 28, 2009 at 18:12 UTC | |
by CRAKRJACK (Initiate) on Aug 28, 2009 at 18:44 UTC | |
by BrowserUk (Patriarch) on Aug 28, 2009 at 19:23 UTC |