http://www.perlmonks.org?node_id=442135


in reply to Re^2: Concerning hash operations (appending, concatenating)
in thread Concerning hash operations (appending, concatenating)

Yeah, but I don't like it. I don't like assigning X to itself like the example does. I'd prefer a slightly long-winded approach:
$hash{$_} = $otherhash{$_} for grep !exists $hash{$_}, keys %otherhash +;
Or:
{ my @new_keys = grep !exists $hash{$_}, keys %otherhash; @hash{@new_keys} = @otherhash{@new_keys}; }
_____________________________________________________
Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart