Maybe this will clarify things for you? (Hint: $a !~~ $b parses as $a !~ (~$b))
c:\test>perl -MO=Deparse 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); ^Z sub BEGIN { require 5.10.0; } BEGIN {${^WARNING_BITS} = "\377\377\377\377\377\377\377\377\377\377\37 +7?"} use strict 'refs'; BEGIN { $^H{'feature_say'} = q(1); $^H{'feature_state'} = q(1); $^H{'feature_switch'} = q(1); } my $a = 'hello'; my $b = 'hello'; print "a matches b\n" if $a ~~ $b; print "a not matches b\n" if not $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 not $a =~ ~~$b; print "a double matches b\n" if $a ~~ ~~$b; print "a not double matches b\n" if not $a =~ ~~~$b; - syntax OK
In reply to Re: Why is to match, not to match?
by BrowserUk
in thread Why is to match, not to match?
by CRAKRJACK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |