good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Reoccuring messageby Bloodnok (Vicar) |
on Jun 09, 2014 at 12:06 UTC ( [id://1089258]=note: print w/replies, xml ) | Need Help?? |
Although use strict; is highly recommended (almost to the point of mandated:-) by monks far more knowledgeable than me, in this case, the behaviour would be identical to that observed - which, IMHO, might provide a use case for the improvement of perl itself by way of identifying the variable that it considers to be read-only within the error message - sometimes I've struggled to try and spot problems such as this.
Anyway, in for ($1 = 0; $i <= 10; $i++) {, you assign a value of 0 to $1, methinx that you meant to write for ($i = 0; $i <= 10; $i++) {, or even for (my $i = 0; $i <= 10; $i++) {. I would also point out that, strictly speaking, the message isn't Reoccuring since it only occurs once per run. Update: Thanx to AnomalousMonk (I do like like name:-), added my to 2nd suggestion.
A user level that continues to overstate my experience :-))
In Section
Seekers of Perl Wisdom
|
|