This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlretut: Emphasize difference of /r
[perl5.git] / pod / perlretut.pod
index 5625358..d8ac91f 100644 (file)
@@ -1726,7 +1726,8 @@ C<print> and the C<s/$regexp/$replacement/go> use C<$_> implicitly.
 
 If you don't want C<s///> to change your original variable you can use
 the non-destructive substitute modifier, C<s///r>.  This changes the
-behavior so that C<s///r> returns the final substituted string:
+behavior so that C<s///r> returns the final substituted string
+(instead of the number of substitutions):
 
     $x = "I like dogs.";
     $y = $x =~ s/dogs/cats/r;