sub hashCopyByKey { my ($to, $from, @key) = @_; @key = grep{ exists $from->{$_} } @key; @{$to->{@key}} = @{$from->{@key}}; }