in reply to Transposing an Array
$w holds $array[index], not index, so just use print "$w\n";. If you do want $w to hold the index, do:
foreach my $w (0..$#array){ print "$array[$w]\n"; }; [download]