in reply to Re^2: Modification of a read-only value attempted?!?
in thread Modification of a read-only value attempted?!?
The difference is that in for my $x (1) {...} the 1 is a literal constant. (0..1) on the other hand is an expression evaluating to the list (0,1). The loop is aliasing to the anonymous elements of the list, not to the literal boundaries in (0..1).
Perhaps it is helpful to consider that for my $x (0,1) {...} also dies with Modification of a read-only value attempted at -e line 1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Modification of a read-only value attempted?!?
by LanX (Saint) on Jan 07, 2024 at 22:10 UTC |