perlop: Mention the s///le special case
authorFather Chrysostomos <sprout@cpan.org>
Mon, 14 Mar 2011 05:28:46 +0000 (22:28 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 14 Mar 2011 05:31:48 +0000 (22:31 -0700)
This is apparently undocumented except in perldiag and a previous
perldelta.

pod/perlop.pod

index 3b7bc0d..046b616 100644 (file)
@@ -1684,6 +1684,14 @@ to occur that you might want.  Here are two common cases:
     # expand tabs to 8-column spacing
     1 while s/\t+/' ' x (length($&)*8 - length($`)%8)/e;
 
+C<s///le> is treated as a substitution followed by the C<le> operator, not
+the C</le> flags.  This may change in a future version of Perl.  It
+produces a warning if warnings are enabled.  To disambiguate, use a space
+or change the order of the flags:
+
+    s/foo/bar/ le 5;  # "le" infix operator
+    s/foo/bar/el;     # "e" and "l" flags
+
 =back
 
 =head2 Quote-Like Operators