projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e85f27
)
perldelta: fix the example of lvalue ref from substr
author
Ricardo Signes
<rjbs@cpan.org>
Sun, 20 May 2012 12:35:04 +0000
(08:35 -0400)
committer
Ricardo Signes
<rjbs@cpan.org>
Sun, 20 May 2012 12:35:04 +0000
(08:35 -0400)
reported by Shlomi Fish
pod/perldelta.pod
patch
|
blob
|
history
diff --git
a/pod/perldelta.pod
b/pod/perldelta.pod
index
4ea10e6
..
3b26bf5
100644
(file)
--- 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