- or download this
$W={
'A' => {
...
},
},
};
- or download this
$X={
'A' => {
...
'U'=>99,
},
};
- or download this
printTree($W); # just dumps HOHOH - could use data::dumper - remove
+d
remove1($W,2); # ie remove layer 2 ( counting from 1 )
...
}
}
}
- or download this
perl delete_mid2.pl
A
...
X
O
U
- or download this
sub deep_copy {
my $this = shift;
...
return {map { $_ => deep_copy($this->{$_}) } keys %$this};
}
}