perl -MData::Dumper -e ' %hash = (a => 3, b=> 4, c=>1 ,d=>7); @sel = qw(b c); @nhash{@sel} = @hash{@sel}; print Dumper \%hash;'