in reply to Re: Combining hashes
in thread Combining hashes

I believe that mpolo actually wants to lose the duplicates, since his intention is to count the total number of countries representated between employee classes.

Also, you can rewrite:

my $totb = 0; $totb += $_ for map { scalar keys %$_; } (\%class1, \%class2, \%class3 +);
as the following:
my $totb = 0; $totb += keys %$_ for \(%class1, %class2, %class3);
No need to iterate twice.
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

Replies are listed 'Best First'.
Re: Re: Re: Combining hashes
by Sifmole (Chaplain) on May 14, 2001 at 04:05 UTC
    Very good point. I felt that something like that could be done to avoid the second iteration. I just gave up before I found it, thanks for showing me.