two-dimensional arrays 
Author Message
 two-dimensional arrays

This has probably been asked before, so my apologies if that is the case.

I need to work with two-dimensional arrays where the second dimension is an array
structure itself of variable length.  Could anyone provide guidance/pointers to a
FAQ or some such archive.

many thanks,
  robin

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Robin McEntire

Valley Forge Labs, Research and Development     voice: 215-648-2191
70 East Swedesford Rd.                          fax:   215-648-2288
Paoli, PA  19301
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Sun, 01 Dec 1996 02:12:43 GMT  
 two-dimensional arrays

Quote:

>I need to work with two-dimensional arrays where the second dimension is an array
>structure itself of variable length.  Could anyone provide guidance/pointers to a
>FAQ or some such archive.

This isn't really a two-dimensional array, it's a vector of vectors.  I've
done this using eval, by representing each row using a variable.

sub array_element {

  local($varname) = "$arrayname_$i";
  eval "$varname" . "[$j]";

Quote:
}

sub set_array_element {

  local($varname) = "${arrayname}_$i";
  eval "$varname" . "[$j] = '$value'";

Quote:
}

I've done similar things to allow associative arrays to contain arrays
(even other associative arrays) as their values.  The value in the
associative array would be the name of a variable whose value is the array.

--
Barry Margolin
System Manager, Thinking Machines Corp.




Mon, 02 Dec 1996 02:25:06 GMT  
 two-dimensional arrays
It's posible to simulate multiple dimensions using associative arrays.
See the discussion of $; in the man page.


Mon, 09 Dec 1996 11:32:24 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Weird Hash w/ n-dimensional two-dimensional array !!!!!!

2. Associative array of a two dimensional array

3. Reading into a two-dimensional array from STDIN

4. how to build two dimensional array?

5. how to build two dimensional array?

6. Two dimensional array

7. Different ways of initialising a two dimensional array

8. Dynamic Two-Dimensional Array Creation?

9. two-dimensional arrays, lists, whatever

10. sort a two-dimensional array....

11. Two dimensional array

12. Need Help with putting Hashes in a two-dimensional array

 

 
Powered by phpBB® Forum Software