[Thousand-oaks-pm] Perl hash question

Gary Ansok ansok at alumni.caltech.edu
Thu Dec 1 22:54:50 PST 2005


Robert Hull wrote:

>I'm looking for a succinct way to join two hashes.  What I would like is:
>
>%foo .= %bar ;
>
>Where %foo retains it values for keys undefined in %bar
>and
>%foo takes %bar values for keys defined in %bar.
>  
>
I believe that

%foo = (%foo, %bar);

will do what you want.

Gary Ansok



More information about the Thousand-oaks-pm mailing list