in reply to Union of hashes

map {$b{$_} = $a{$_}} keys %a;
Does a similar thing

Replies are listed 'Best First'.
Re: Re: Union of hashes
by merlyn (Sage) on Feb 07, 2002 at 16:43 UTC
    Only in the sense that
    print "hello world";
    and
    print $_ for split //, "hello world";
    do "similar things". The void map solution is to be avoided, especially when there are so many better solutions.

    -- Randal L. Schwartz, Perl hacker

      Like masem's most excellent Hash::Merge. It does deep hashes, and optionally does true copies instead of references.