in reply to I should've known better!
Yes, well, I should have known better too. :-)
In fact, in Perl 6, the equivalent loop:
makes $line a read-only alias to catch just this sort of mixup. You'd write:for @text -> $line { ... }
(note the double-ended arrow) to get the read-write semantics. But it's not the default. Perl 6 is all about picking sane defaults while not preventing you from doing the sorts of powerful things you can do in Perl 5.for @text <-> $line { ... }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: I should've known better!
by GrandFather (Saint) on Sep 11, 2009 at 03:01 UTC | |
by moritz (Cardinal) on Sep 14, 2009 at 14:16 UTC |
In Section
Meditations