Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Excluding words with more than three a

by Anonymous Monk
on Dec 20, 2001 at 06:45 UTC ( [id://133385]=note: print w/replies, xml ) Need Help??


in reply to Excluding words with more than three a

This shud werk:
open(FH, "dikshunary") or die "Can't open dictionary: $!"; while (<FH>) { my ($a, $b, $k) = (0,0,0); for my $i (0..length) { $a=$a+1 if (split '', $_)[$i] eq "a"; $b=$b+1 if (split '', $_)[$i] eq "b"; $k=$k+1 if (split '', $_)[$i] eq "k"; } next if $a > 3 or $b > 2 or $k > 2; print; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found