T
TonyShirt
I've been using dclone to copy a hash to another hash. At one point
in my program I need to copy one element of a hash into another.
Heres the code
my %a = { 1 => {a1=> 1, a2 =>2, a3=>3
2 => {a1=> 4, a2 =>5, a3=>6};
my %b = %{ dclone(\%a) }
#now I want to clear %b and copy a element from a% into %b
my %b=();
$b{1} = dclone( $a{1}); # This dosent seem to work!
Any suggestions?
in my program I need to copy one element of a hash into another.
Heres the code
my %a = { 1 => {a1=> 1, a2 =>2, a3=>3
2 => {a1=> 4, a2 =>5, a3=>6};
my %b = %{ dclone(\%a) }
#now I want to clear %b and copy a element from a% into %b
my %b=();
$b{1} = dclone( $a{1}); # This dosent seem to work!
Any suggestions?