gholley has asked for the wisdom of the Perl Monks concerning the following question:
I want the final hash to have (font=>'Arial',size=>12,bold=>0) so that the values in %b overwrite values in %a where necessary. I'd like to be sure that in future versions of Perl, %a won't suddenly decide to start overwriting %b. I don't think it should make a difference, but I don't actually plan to create the third hash explicitly; instead, I'll use it in a function call:%a = (font => 'Arial', size => 10, bold => 0); %b = (size => 12); %fmt = (%a, %b);
My hashes are small and insignificant, yet dear to me. But because they are small I am more concerned with shortness and clarity of the code than with raw efficiency.$object->write( 'Some Stuff', $object2->format( %a, (size => 12)) );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple concatenation of hashes
by sauoq (Abbot) on Aug 15, 2003 at 00:36 UTC | |
|
Re: Simple concatenation of hashes
by chromatic (Archbishop) on Aug 15, 2003 at 01:00 UTC | |
by Anonymous Monk on Aug 15, 2003 at 03:29 UTC | |
by gholley (Initiate) on Aug 15, 2003 at 03:32 UTC | |
|
Re: Simple concatenation of hashes
by thelenm (Vicar) on Aug 15, 2003 at 06:38 UTC | |
|
Re: Simple concatenation of hashes
by gholley (Initiate) on Aug 15, 2003 at 00:07 UTC | |
|
Re: Simple concatenation of hashes
by esh (Pilgrim) on Aug 15, 2003 at 00:19 UTC |