in reply to Questions about using array-of-arrays
take one "row" of my array-of-arrays and copy it to a separate array:
@SeparateArray = @{ MyAoA[$i] };
@SeparateArray = @{ $MyAoA[$i] };
copy my separate array into a row of my array-of-arrays
@{ $MyAoA[$i] } = [ @SeparateArray ];
$MyAoA[$i] = \@SeparateArray ;
copy an entire array-of-arrays (and not just have references to the first one)
(note, this last one only works for AoA, not for AoAoA and deeper. For that situation, it may be easier to use Storable's dclone method)push @new_array,[@$_] foreach @old_array or @new_array = map {[@$_]} @old_array
Clint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Questions about using array-of-arrays
by polettix (Vicar) on Jul 26, 2007 at 13:04 UTC |