develooper Front page | perl.perl5.porters | Postings from January 2010

Should C<++$_ for -1..1> croak?

Thread Next
From:
Dr.Ruud
Date:
January 28, 2010 15:24
Subject:
Should C<++$_ for -1..1> croak?
Message ID:
20100128231253.4784.qmail@lists-nntp.develooper.com
Should C<++$_ for -1..1> croak?

Or is it better to leave it as it is?


Example 1:
$ perl -wle'++$_ for 1..1'

Example 2:
$ perl -wle'++$_ for 1'
Modification of a read-only value attempted at -e line 1.


-- 
Ruud

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About