Mike Li skribis 2005-12-04 13:10 (-0500): > in perl5, i would've written something like: > my $x = 0; my @y = 1..9; @y[$x++]++; print "$x\n"; print "@y\n" > but in perl6, the '@' sigil always means list context, so should i > write the following? > my $x = 0; my @y = 1..9; [EMAIL PROTECTED]; print "$x\n"; print "@y\n"
The @ sigil does not create list context. In general, every $foo[$bar] from Perl 5 can be written as @foo[$bar] in Perl 6. @foo[$bar++]++ is neither weird nor wrong. Ugly, yes, that it is. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html