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 ( #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? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2022-08-10 17:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?