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:
Or:$hash{$_} = $otherhash{$_} for grep !exists $hash{$_}, keys %otherhash +;
{ my @new_keys = grep !exists $hash{$_}, keys %otherhash; @hash{@new_keys} = @otherhash{@new_keys}; }
In Section
Seekers of Perl Wisdom