in reply to Copying a hash to another hash problem

It looks to me like your problem is that you arent using strict.

The reason I say this is that the hash that $framearray->{$frameno}{$drawerno} refers to isnt %framearray, but rather an anonymous hash contained referenced by $framearray

So you have two solutions, change the offending call to $framearray{$frameno}{$drawerno}="foo"; _or_ change the %newhash=%framearray to be %newhash=%$framearray

But as I said this type of error would be instantly indentified by turning on strict.

my %hash; $hash{foo}{bar}="baz"; my %new=%hash; print $new{foo}{bar},"\n"; #prints baz my $hashref; $hashref->{foo}{bar}='ref'; my %new2=%$hashref; print $new2{foo}{bar},"\n"; #prints baz
BTW, you should realize that %x=%y will only do a shallow copy on nested HOH's. In otherword the subhash in $hash{foo} and in $new{foo} will be the same. Thus
$new{foo}{baz}='new'; print $hash{foo}{baz},"\n"; #prints new
Taking a deep copy is more complicated, and I wont address it unless you follow up saying that you need to do so.

HTH

--- demerphq
my friends call me, usually because I'm late....