> Is it shorthand for a foreach loop?
ehm ... well the effect is analogous to many scalar assignments
$ranks[ $sorted_positions[$_] ] = $_ for 0 .. $#sorted_positions
but actually it's an assignment of list to list
> Does perl increment the index for both arrays automatically?
there is no increment after the range operator created a list on the RHS.
Cheers Rolf
( addicted to the Perl Programming Language)
In reply to Re: Loops in Perl
by LanX
in thread Loops in Perl
by carlriz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |