At 10:53 AM 7/27/2001, you wrote:
>Try:
>
>    my %data = ( %one, %two %three, %four );

This is a good solution, but be careful of one thing.  If there are 
duplicate keys in any of the hashes, the last in will win.  Meaning, that 
if you have a key of 'my key' in %one and in %four, the value of 'my key' 
in %four will end up in %data, and the one in %one will get silently 
clobbered.

If you want to have explicit rules as to what hash is supposed to win, 
you'll either have to be careful of the order of the hashes on the 
right-hand side, or you can use the subroutine to implement some resolution 
logic.  But for simple cases, like if you always want the value from %one 
to win, you could just say:

         my %data = ( %two %three, %four, %one );

This way the values from %one will always clobber duplicate keys from the 
other hashes.

Later,

Sean.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to