Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Help on array element counting

by Hena (Friar)
on Oct 28, 2003 at 07:44 UTC ( [id://302655]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @fruits = qw/ MANGO APPLE GRAPES MANGO MANGO MANGO MANGO
                  APPLES APPLES BANANA CORN APPLES /;
    
    ...
    foreach (sort {$count{$a} <=> $count{$b}} keys %count) {
      print "$_ => $count{$_}\n";
    }
    
  2. or download this
    foreach (sort {lc($a) cmp lc($b)} keys %count) {
      print "$_ => $count{$_}\n";
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found