summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Signes <rjbs@cpan.org>2012-05-20 08:35:04 -0400
committerRicardo Signes <rjbs@cpan.org>2012-05-20 08:35:04 -0400
commit5bbddb3107caeabc49fafc882f7b50e41274fd91 (patch)
tree32a3733520a5e002970426c478c7969200d9bfc5
parent2e85f27811e17c0360d5f88f5276a874a1f361db (diff)
downloadperl-5bbddb3107caeabc49fafc882f7b50e41274fd91.tar.gz
perldelta: fix the example of lvalue ref from substr
reported by Shlomi Fish
-rw-r--r--pod/perldelta.pod4
1 files changed, 2 insertions, 2 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 4ea10e63d2..3b26bf5c1e 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -116,9 +116,9 @@ their position from the end of the string, affecting code like this:
my $string = "string";
my $lvalue = \substr $string, -4, 2;
- print $lvalue, "\n"; # prints "ri"
+ print $$lvalue, "\n"; # prints "ri"
$string = "bailing twine";
- print $lvalue, "\n"; # prints "wi"; used to print "il"
+ print $$lvalue, "\n"; # prints "wi"; used to print "il"
The same thing happens with an omitted third argument. The returned
lvalue will always extend to the end of the string, even if the string