diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-09-22 20:31:19 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-09-22 20:31:19 +0000 |
commit | ac117f44706c30c5e23f7295ec8491b4705a1c77 (patch) | |
tree | 208668b31fb423d88021aa00a1df467be65526c8 /t | |
parent | b6c835310a005ce2e1187890772df402e7333876 (diff) | |
download | perl-ac117f44706c30c5e23f7295ec8491b4705a1c77.tar.gz |
When localising a magic value, propagate the readonly flag
only if this scalar has \0 magic or has magic without a
'set' method. (follows change #20479 for bug #23141.)
p4raw-link: @20479 on //depot/perl: 33f3c7b8444b48791ad016570a41a23483d750d2
p4raw-id: //depot/perl@21323
Diffstat (limited to 't')
-rwxr-xr-x | t/op/local.t | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/op/local.t b/t/op/local.t index 5a5b7ee552..28613e7a13 100755 --- a/t/op/local.t +++ b/t/op/local.t @@ -1,6 +1,6 @@ #!./perl -print "1..78\n"; +print "1..79\n"; sub foo { local($a, $b) = @_; @@ -271,3 +271,8 @@ print "ok 77\n"; eval { for ($1) { local $_ = 1 } }; print "not " if $@; print "ok 78\n"; + +# The s/// adds 'g' magic to $_, but it should remain non-readonly +eval { for("a") { for $x (1,2) { local $_="b"; s/(.*)/+$1/ } } }; +print "not " if $@; +print "ok 79\n"; |