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.