Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Help on array element counting

by monktim (Friar)
on Oct 27, 2003 at 19:37 UTC ( [id://302492]=note: print w/replies, xml ) Need Help??


in reply to Help on array element counting

use strict; my @array = <DATA>; chomp @array; my %cnt; $cnt{$_}++ foreach (@array); print "$_ => $cnt{$_}\n" foreach (keys %cnt); __DATA__ MANGO APPLE GRAPES MANGO MANGO MANGO MANGO APPLES APPLES BANANA CORN APPLES

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://302492]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found