Build multidimensional array from arrays

From: Kevin Old (kold_at_kold.homelinux.com)
Date: 01/29/04


To: beginners@perl.org
Date: Thu, 29 Jan 2004 11:46:10 -0500

Hello everyone,

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.

Kevin

-- 
Kevin Old <kold@kold.homelinux.com>


Relevant Pages

  • Re: Global Variables
    ... > a dynamically malloced multidim array or pass around pointers to it. ... > I want to dynamically create a multidimensional array and write code to ... > I pass the pointer to other routines that need to access it. ...
    (comp.lang.c)
  • Re: Query returning array
    ... Karl Groves wrote: ... would return an array with the keys: ... I'm wondering where I went wrong in writing the function below. ... I'm getting a multidimensional array and want a single dimension. ...
    (comp.lang.php)
  • Re: Set up array to write to table?
    ... You *can* use ReDim Preserve with a multidimensional array. ... One more thing I think I _did_ understand - I've used ReDim Preserve ... Jonathan West - Word MVP ...
    (microsoft.public.word.vba.general)
  • Multidimensional array storage referred to as "index sets" in spec
    ... The length of the series must equal the rank of the array. ... one index set for the array "a" above and I created it with my ... the vector position of an array element is nothing but a hardcoded ... internally a multidimensional array is stored as a one-dimensional ...
    (comp.lang.lisp)
  • Re: array population from system app call
    ... maybe I am not understanding when a multidimensional array would be ... when are these references useful? ... > am I confusing a normal array with a MDarray? ... Can you show a sample output of `evmvol -w label_state`? ...
    (perl.beginners)