Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: Golf: Improve this guy's fail . . . please!

by mr_mischief (Monsignor)
on Jul 01, 2009 at 01:24 UTC ( [id://776231]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ++$t,++$c{$_}for map/\w/g,<>;
    print$_,' ',$c{$_},' ',$c{$_}/$t*100,$/for sort keys%c;
    print"Total: $t\n"
    
  2. or download this
    ++$t, ++$c{$_} for map /\w/g, <>;
    for ( sort keys %c ) {
    ...
        printf "%-5s%5d%7s%%\n", $_, $c{$_}, $p;
    }
    print 'Distinct: ' . (scalar keys %c) . "\tTotal: $t\n"
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 22:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found