This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
move given/when ~~ note below item introducing it
authorDoug Bell <madcityzen@gmail.com>
Tue, 13 May 2014 00:50:41 +0000 (10:50 +1000)
committerTony Cook <tony@develop-help.com>
Thu, 29 May 2014 01:19:02 +0000 (11:19 +1000)
The note explaining to use $c ~~ $_ instead of $_ ~~ $c was put under the item
introducing all binary operators, and not the one mentioning the explicit
smartmatch operator.

pod/perlsyn.pod

index 9ce8b3c..244372c 100644 (file)
@@ -958,6 +958,9 @@ the form C<!/REGEX/>, C<$foo !~ /REGEX/>, or C<$foo !~ EXPR>.
 
 A smart match that uses an explicit C<~~> operator, such as C<EXPR ~~ EXPR>.
 
+B<NOTE:> You will often have to use C<$c ~~ $_> because the default case 
+uses C<$_ ~~ $c> , which is frequentlythe opposite of what you want.
+
 =item Z<>4.
 
 A boolean comparison operator such as C<$_ E<lt> 10> or C<$x eq "abc">.  The
@@ -965,10 +968,6 @@ relational operators that this applies to are the six numeric comparisons
 (C<< < >>, C<< > >>, C<< <= >>, C<< >= >>, C<< == >>, and C<< != >>), and
 the six string comparisons (C<lt>, C<gt>, C<le>, C<ge>, C<eq>, and C<ne>).
 
-B<NOTE:> You will often have to use C<$c ~~ $_> because
-the default case uses C<$_ ~~ $c> , which is frequently
-the opposite of what you want.
-
 =item Z<>5.
 
 At least the three builtin functions C<defined(...)>, C<exists(...)>, and