Kevin Old wrote: > > I have: > > @one = qw(A B C D); > @two = qw(E F G H); > > I want to build a multidimensional array from the above arrays. I want > to put @one in the first "column" of the array. I want to put @two in > the second "column" of the array. > > I want the resulting MDA to look like: > > @mda = ( > [A][E], > [B][F], > [C][G], > [D][H] > ); > > Any ideas? Sorry if this is not clear.
Too many ideas! It would have helped if @mda was built in valid Perl syntax and referred to the arrays that you say it must be built from. Here's a starting point: my @one = qw(A B C D); my @two = qw(E F G H); my @mda; my $i = 0; foreach (@one) { push @mda, [$one[$i], $two[$i]]; $i++; } but /please/ go back a few steps and explain what you want you're trying to do. I doubt that putting characters 'A' .. 'H' into an array is your goal. What you're starting with and what end you have in mind is fundamental. Abstract as little as you can. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>