Hi,

I am wondering if the performance (time efficiency) of hash of hash is bad. I has this impression from the code I developed. Basically my structure needs to hold the members of different groups. I have different choices:

hash:
$groups{$g1} = "$member1:$member2:$member3...";
but everytime I need the members of a group, I need to do a split, and when I need to check if a member is in a group, I need to do a loop.

hash of hash
$groups{$g1}{$member1} = 1;
but this one is really slow from what i see.

hash of lists
$groups{$g1} = ($member1, $member2, ...);
I need a loop for checking if a member is in a group.

another hash
$groups{$g1:$member1} = 1;

Can anyone give me some suggestions which one is better? Many thanks,
 -Zhenhai

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to