Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Creating Dictionaries

by davidrw (Prior)
on Dec 16, 2005 at 14:12 UTC ( [id://517242]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (my ($word) = (lc $word) =~ /[a-z]{2,}/g) {
    
  2. or download this
    my %hash;
    while (my $line = <STDIN>) {
    ...
        }
    }
    print "$_\n" for sort keys %hash;
    
  3. or download this
    while (my $line = <STDIN>) {
        $hash{lc $_}++ for $line =~ m/\b([a-zA-Z]{2,4})\b/g;
    }
    #or
    do { $hash{lc $_}++ for m/\b([a-zA-Z]{2,4})\b/g } for <STDIN>;
    
  4. or download this
    while (my $line = <STDIN>) {
        $hash{lc $_}++ for $line =~ m/([a-zA-Z]{2,})/g;
    }
    delete $hash{$_} for grep /(\w)\1{4}/, keys %hash;
    

Log In?
Username:
Password:

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

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

    No recent polls found