Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

uksza's scratchpad

by uksza (Abbot)
on Sep 03, 2004 at 21:28 UTC ( #388419=scratchpad: print w/replies, xml ) Need Help??

#!/usr/bin/perl #getting while (<stdin>) { chomp; s/\s{2,}//g; s/[^a-zA-z\s]//g; last if ( $_ eq "" ) ; if (m/\w\s\w/) { push @words, (split); next; } push @words, $_; } #counting foreach (@words) { $list{$_} = length; } #printing @result = sort { $list{$b} <=> $list{$a} } keys %list; print "\n"; foreach (@result) { print "$_\n";

Vim as a Perl IDE (perl-support.vim)
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2017-06-26 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (583 votes). Check out past polls.