$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"; };
In reply to Re: Transposing an Array
by ikegami
in thread Transposing an Array
by JustLikeThat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |