Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: counting elements using a hash

by Kenosis (Priest)
on Sep 23, 2012 at 06:58 UTC ( [id://995176]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    
    print "Number: $_\tCount: $numbers{$_}\n"
      for sort { $a <=> $b } keys %numbers;
    
  2. or download this
    12.7 abce -3.14 21
    This is a line with 8 words in it.
    10000 is a big number.
    Looks like 21 and 12.7 again.
    5 + 7 = 12
    
  3. or download this
    Number: -3.14    Count: 1
    Number: 5    Count: 1
    ...
    Number: 12.7    Count: 2
    Number: 21    Count: 2
    Number: 10000    Count: 1
    

Log In?
Username:
Password:

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

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

    No recent polls found