In Perl 5 my $var; ... for $var (...) {...} doesn't alter the contents of the $var global to the for loop. Is that true for both the -> and <-> variants of the Perl 6 for loop illustrated above?Yes.
presume you can for @array <-> my $var {...}, in Perl 6 to make the scope of $var obvious.No, you can't. Both arrows actually introduce a signature, and my in a signature doesn't make sense.
I used to write -> my $x too, but got used to omitting the my rather quickly :-).
In reply to Re^3: I should've known better!
by moritz
in thread I should've known better!
by ack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |