in reply to How do I move specific values from one hash to another?

$newhash{$key} = $oldhash{$key}; delete $oldhash{$key};

Replies are listed 'Best First'.
(tye)Re: How do I move specific values from one hash to another?
by tye (Sage) on May 14, 2001 at 23:20 UTC

    I prefer this:

    $newhash{$key}= delete $oldhash{$key}; #or @newhash{@keys}= delete @oldhash{@keys};

            - tye (but my friends call me "Tye")
Re: Re: How do I move specific values from one hash to another?
by suaveant (Parson) on May 14, 2001 at 23:22 UTC
    or...
    $newhash{$key} = delete $oldhash{$key};
    for a one line approach

    Update ack! Tye beat me to it... :)
                    - Ant