summaryrefslogtreecommitdiff
path: root/t/op/substr.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/substr.t')
-rw-r--r--t/op/substr.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/substr.t b/t/op/substr.t
index ceacdf6e47..abd5d7f630 100644
--- a/t/op/substr.t
+++ b/t/op/substr.t
@@ -23,7 +23,7 @@ $SIG{__WARN__} = sub {
BEGIN { require './test.pl'; }
-plan(381);
+plan(382);
run_tests() unless caller;
@@ -684,6 +684,13 @@ is($x, "\x{100}\x{200}\xFFb");
}
}
+# Also part of perl #24346; scalar(substr...) should not affect lvalueness
+{
+ my $str = "abcdef";
+ sub { $_[0] = 'dea' }->( scalar substr $str, 3, 2 );
+ is $str, 'abcdeaf', 'scalar does not affect lvalueness of substr';
+}
+
# [perl #24200] string corruption with lvalue sub
{