diff options
Diffstat (limited to 't/op/substr.t')
-rwxr-xr-x | t/op/substr.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/op/substr.t b/t/op/substr.t index dfb483aee5..4df6426388 100755 --- a/t/op/substr.t +++ b/t/op/substr.t @@ -1,6 +1,6 @@ #!./perl -print "1..177\n"; +print "1..179\n"; #P = start of string Q = start of substr R = end of substr S = end of string @@ -609,3 +609,14 @@ ok 174, $x eq "\x{100}\x{200}\xFFb"; my $y = substr $x, 4; ok 177, substr($x, 7, 1) eq "7"; } + +# [perl #24200] string corruption with lvalue sub + +{ + my $foo = "a"; + sub bar: lvalue { substr $foo, 0 } + bar = "XXX"; + ok 178, bar eq 'XXX'; + $foo = '123456789'; + ok 179, bar eq '123456789'; +} |