in reply to Re: Modification of a read-only value attempted?!?
in thread Modification of a read-only value attempted?!?

I don't see an explanation for the difference between for my $x (1)... and for my $x (0 .. 1)... here.

Update:
haj explained it perfectly in Re^3: Modification of a read-only value attempted?!?

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Replies are listed 'Best First'.
Re^3: Modification of a read-only value attempted?!?
by ikegami (Patriarch) on Jan 09, 2024 at 19:39 UTC

    While 0 and 1 evaluate to a constant, 0..1 evaluates to two scalars which aren't constants.

    That said, for (0..1) doesn't actually use the range operator as an optimization. But the result is the same.