Re: counting word occurances
- From: "Jürgen Exner" <jurgenex@xxxxxxxxxxx>
- Date: Thu, 02 Jun 2005 02:49:10 GMT
Rodrick Brown wrote:
> apple
> orange
> pear
> pear
> magno
> apple
>
> Given the following data can someone show me example code on how to
> count how many of each different fruit
Well, assuming @foo contains the list of fruit, then
for (@foo) {
$bar{$_}++;}
will place the count in %bar.
> output should be somehting like
The rest is left as an excercise.
jue
.
- References:
- counting word occurances
- From: Rodrick Brown
- counting word occurances
- Prev by Date: Re: counting word occurances
- Next by Date: summarize bytes
- Previous by thread: Re: counting word occurances
- Next by thread: summarize bytes
- Index(es):
Relevant Pages
|