Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: array counting

by mephit (Scribe)
on Jun 20, 2002 at 22:09 UTC ( [id://176173]=note: print w/replies, xml ) Need Help??


in reply to How can I count and display unique items in an array? (was: array counting)

@a = qw/foo bar foo baz bar qux foo/; $hash{$_}++ foreach @a;
The counts are in %hash now. HTH.

--

There are 10 kinds of people -- those that understand binary, and those that don't.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (None)
    As of 2024-04-25 00:35 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found