The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
the list assignment returns the length of the list in scalar context, so
So it's not the same code! The difference between your code and my example is that there is no explicit variable (like $l) used here, but somehow it's still possible to change it. Maybe it's a side effect of for ? I dunno. I'd prefer a Can't modify warning here too! But it's still a very peculiar construction, so I'm not surprised if this edge case wasn't covered. HTH!
Cheers Rolf
updateMore insights: ... it's not the temporary scalar which is modified but the resulting list in brackets
According to the already cited documentation of "combined assignments" this shouldn't be possible, b/c its a list operation. In reply to Re^3: ... for (@_) x= 2; (scalar assignment)
by LanX
|
|