> I have thre HoAs with the same key but different value.
> How can I efficiently join the HoA:
>
> my %HoA = (key1 => ['A',1]);
> my %HoA2 = (key1 => ['B',2]);
> my %HoA3 = (key1 => ['C',2]);
>
> into:
>
> %HoA = (key1 => ['A',1],['B',2],['C',2]);
I'm not sure what you want to do here... do you want to combine all
the values into one array reference, stored in $HoA{key1}? Or do you
want $HoA{key1} to be an array of arrays?
Another solution might be to use a hash of hashes:
%HoA = (
key1 => {
A => 1,
B => 2,
C => 3
}
);
This sounds like it's part of a bigger question. Can you give us some
more background info?
Dave
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>