in reply to using arrays of arrays

If you are looking to create an exact copy of any perl data structure, then you can use the dclone() function from Storable.pm

Obviously if you clone a big data structure that way it will take a while, and will burn a lot of memory, so if you are looking to change a small amount of a large data structure, you may want to consider a more advanced algorithm.

Don't do what I did when I was a novice which is to write code like this:

foreach my $key1 (keys %$foo) { foreach my $key2 (keys %{$foo->{$key1}}) { # etc.... $bar->[$idx1][$idx2]..[$idx5] = $foo->{$key1}{$key2}..{$key5};