|
| Recent
Articles |

Continuation Lines here's been a long standing Unix convention of breaking long lines with a "" to make them easier to read. You'd almost always see this in files like /etc/printcap, but there are plenty of other places where this convention is used.
Whatever, Perl 6 Is On The Way Larry Wall's recent State of the Onion address concerned Perl 6 and the concept of being prepared to do "whatever" in the context of the next version of the language.
The Hidden Loop Programmers use loops to avoid writing repetitive code, but sometimes forget that compilers will unroll their loops when possible for efficiency. You can unroll your own loops, too. Rather than testing and...
Webmin, Usermin Need Updates The French Security Incident Response Team (FrSIRT) has reported a pair of vulnerabilities in Webmin and Usermin that could be exploited by remote attackers. FrSIRT said in its advisory that the pair of flaws pose...
Seeing Perl In Google Code Google's release of a code repository for open source projects has a number of languages represented, including Perl. Perl -- It's like Java, only it lets you deliver on time and under budget. -- quote seen...
Perl Plus Jifty Equals Hiveminder Yes, Jifty is another web application builder, and yes, Hiveminder is another to-do list; but it is Perl that made them possible. A post by Jesse Vincent at UsePerl...
|
 |
|
10.24.06
Perl Loop Causes Strange Read-only Error
By
A.P. Lawrence
Ok, folks: I don't understand this. It must have something to do with anonymous arrays in Perl (no, it doesn't, I realize now), but I don't grok the connection.
I ran into this in attempting a seemingly simple change in some customer's code; it wasn't hard to fix, but I simply do not understand why this happened.
Well, that's not precisely true: it happened because I went ahead in a hurry and added something "quick". It was just a new loop around some existing code. Ordinarily I would have written it like this:
But for some reason I did this instead:
When run, that produces:
Caroomba called first
Caroomba called foo
Caroomba called ba
Caroomba called foo2
Caroomba called ba2
Caroomba called foo3 Modification of a read-only value attempted at ./t.pl line 23, <I> line 23.
Why? Dude, werent you listening? I do not comprehend why. Some person with more brains than I currently have will have to explain that one to both of us.
*Originally published at APLawrence.com
|