Hi all, I have the following code:

############# code################
@cpv_codes=('a','a','a','a','b','b','b','c','c','d');

my %hash;
foreach (@letters) {
   $hash{$_}++;
   print "$_\t $hash{$_} \n";
}
################################



and it prints:

a        1
a        2
a        3
a        4
b        1
b        2
b        3
c        1
c        2
d        1



What I really need is:

a = 4
b = 3
c = 2
d = 1


How would I do this?  Any ideas?


Cheers,

Graeme :)




Public Sub House()

On Error Resume drink

        If Pint.empty = True Then
                Pint.refill
  Else
                Pint.drink
        End if

stomach.add Pint

MsgBox " I've had .... " & stomach.count & " Pints"
MsgBox "VERY DRUNK"

End Sub



--
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