Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Output data to a table or horizontal bar chart

by hippo (Chancellor)
on May 18, 2018 at 10:55 UTC ( #1214835=note: print w/replies, xml ) Need Help??


in reply to Re^2: OUTPUT Data to a table or horizontal bar chart
in thread OUTPUT Data to a table or horizontal bar chart

The "first column" is the key and the "second column" is the value. See the FAQ How do I sort a hash (optionally by value instead of key)? which discusses sorting by value as you now require here.

  • Comment on Re^3: Output data to a table or horizontal bar chart

Replies are listed 'Best First'.
Re^4: Output data to a table or horizontal bar chart
by theravadamonk (Scribe) on May 18, 2018 at 11:41 UTC

    I changed below code

    for my $word (sort keys %count) {
    to
    for my $word (sort { $count{$b} <=> $count{$a} } keys %count) {
    It seems to work. Anyway, Your Ideas r welcome

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2020-11-25 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?