in reply to HowTo Href_O_Href slice

sgrey:

You do it like this:

$ cat foo.pl #!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $hr = { KEY11=>{a=>1, b=>2, c=>3, d=>4}, KEY12=>{a=>10, b=>20, c=>30, d=>40} }; @{$$hr{KEY11}}{qw(a b)} = @{$$hr{KEY12}}{qw(c d)}; print Dumper($hr);

which gives you this:

$ perl foo.pl $VAR1 = { 'KEY12' => { 'c' => 30, 'a' => 10, 'b' => 20, 'd' => 40 }, 'KEY11' => { 'c' => 3, 'a' => 30, 'b' => 40, 'd' => 4 } };

Update: Oops--I read your question wrong. Oh, well, at least this example shows how to copy a slice of values to a different slice...

...roboticus

When your only tool is a hammer, all problems look like your thumb.