In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/e792e8c06267200185d8d7239eff4887535aa1ac?hp=f1f71a0091d3d691043f1da231e5b75df08737b6>
- Log ----------------------------------------------------------------- commit e792e8c06267200185d8d7239eff4887535aa1ac Author: Lukas Mai <l....@web.de> Date: Sun Aug 20 21:12:17 2017 +0200 perlop: fix documentation for s/// "false" return value Commit a0d0e21ea6ea90a2231 ("perl-5.000") added perlop.pod, where s/// was described as returning 0 if no substitutions were made. commit e37d713d85ec003d03d ("perl 5.003_01: pod/perlop.pod") then "fixed" the documentation by saying it returns the empty string instead. And that's how it's been since 1996. What s/// actually returns on match failure is the canonical false value, which is both "" and 0 at the same time (depending on numeric/string context). ----------------------------------------------------------------------- Summary of changes: pod/perlop.pod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pod/perlop.pod b/pod/perlop.pod index d7c52be36d..410085ffbc 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -2066,7 +2066,8 @@ X<regexp, substitute> X</m> X</s> X</i> X</x> X</p> X</o> X</g> X</c> X</e> X</r Searches a string for a pattern, and if found, replaces that pattern with the replacement text and returns the number of substitutions -made. Otherwise it returns false (specifically, the empty string). +made. Otherwise it returns false (a value that is both an empty string (C<"">) +and numeric zero (C<0>) as described in L</Relational Operators>). If the C</r> (non-destructive) option is used then it runs the substitution on a copy of the string and instead of returning the -- Perl5 Master Repository