in reply to Re^15: ref to read-only alias ... why? (notabug)
in thread ref to read-only alias ... why?
Exactly the same aliasing occurs for both for(1..3) and for(1).
I'm sorry, but you're dead wrong here:
clearly, there are two different mechanisms: the first does not do aliasing, whereas the second does.my $a = 2; $_++ for 1..$a; print "$a\n"; # 2 my $a = 2; $_++ for $a; print "$a\n"; # 3
But anyway, I still don't understand the "working case" you referred to that my patch will break. Could you please produce that?
Intentionally coded to return a value that can be changed without causing a read-only error.
Is there any proof of that intention? Best in perldoc?
In Section
Seekers of Perl Wisdom