for my $index ( 0 .. $#$subarray ) { my $value = $subarray->[ $index ]; ... }