in reply to Re: lvalue substring oddities
in thread lvalue substring oddities

I've become persuaded that the current behavior should be kept. It is deducible from operator precedence and, once known, is not the cause of any great confusion.
Somewhat agree. The existing behaviour is also IMO easier to document clearly than with the proposed change.

But to throw fuel on the fire:

$ perl -wl $x = "abc"; for $z (substr($x,1,1)) { print ":$z:"; $z = "zz"; print ":$z:" } __END__ :b: :z:
If you alias something to the substr or pass it as a parameter, you can get some pretty odd results currently. OTOH, this is not a lot different from this case:
"abc"=~/.(.)/; for $z ($1) { print ":$z:"; "zz" =~ /.(.)/; print ":$z:" }