Steve C <> writes:
> Dr.Ruud wrote:
>> Should C<++$_ for -1..1> croak?
>>
>> Or is it better to leave it as it is?
>>
>>
>>
>> $ perl -wle'++$_ for 1..1'
>>
>>
>> $ perl -wle'++$_ for 1'
>> Modification of a read-only value attempted at -e line 1.
>
> for implicitly aliases $_ to the constant 1, which cannot be
> incremented.
Note that there are two examples and only the last one complains about a
modification of ro value.
--
John Bokma j3b
Hacking & Hiking in Mexico -
http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development