Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How do you place words from a sentence into an array?

by TedPride (Priest)
on Oct 26, 2004 at 21:10 UTC ( [id://402801]=note: print w/replies, xml ) Need Help??


in reply to How do you place words from a sentence into an array?

The following tracks word frequency:
use strict; use warnings; my %hash; while (<DATA>) { chomp; $hash{$_}++ for (split); } print "ALPHABETIC\n"; print "$_ $hash{$_}\n" for (sort keys %hash); print "\nBY NUMBER\n"; print "$_ $hash{$_}\n" for (sort {$hash{$b} <=> $hash{$a} || $a cmp $b} keys %hash); __DATA__ three blind mice three blind mice see how they run

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-04-24 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found