<?xml version="1.0" encoding="windows-1252"?>
<node id="488541" title="Re: Slicing and Destructing a Hash" created="2005-09-01 23:32:00" updated="2005-09-01 19:32:00">
<type id="11">
note</type>
<author id="169829">
Enlil</author>
<data>
<field name="doctext">
Something like so?&lt;code&gt;
use warnings;
use strict;
use Data::Dumper;
my %hash = (a =&gt; 3, b=&gt; 4, c =&gt;1 ,d=&gt;7); 
my @sel = qw(b c); 
my %nhash;
@nhash{@sel} = delete @hash{@sel}; 
print Dumper \%hash;
print Dumper \%nhash;
__END__
$VAR1 = {
          'a' =&gt; 3,
          'd' =&gt; 7
        };
$VAR1 = {
          'c' =&gt; 1,
          'b' =&gt; 4
        };
&lt;/code&gt;
&lt;p&gt;-enlil

</field>
<field name="root_node">
488539</field>
<field name="parent_node">
488539</field>
</data>
</node>
