LN> I am attempting to create a hash slice from a hash.  The hash is:

LN> %hash =            ("test1" => "test10",
LN>                            "test2" => "test12" ,
LN>                           "test3" => "test13")

LN> I want the slice to include only the keys test1 and test3.  How can I
LN> accomplish this?

you could use map:

  my %new_hash = map { $_ => $hash{$_} } qw(test1 test2);

map is a really useful function...

hth,
daniel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to