use List::Util qw( max ); my @two_dim = map { [ $array1[$_], $array2[$_] ] } 0 .. max( $#array1, $#array2 );
This assumes you have List::Util (a safe assumption). If one array is longer than the other, the "missing" entries will be undef.
In reply to Re: Creating two dimensional array
by kyle
in thread Creating two dimensional array
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |