perlmoth has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use diagnostics; # open DICT, "/usr/dict/words"; open DICT, "/tmp/web2.txt"; my @words_of_15_letters; while (<DICT>) { push @words_of_15_letters, $_ if /^.{15}$/; } print "Number of words found ", scalar @words_of_15_letters, "\n"; foreach my $word (@words_of_15_letters) { my %letter_count; my $repeat_found; foreach my $letter (split //, $word) { $letter_count{$letter}++; } foreach (keys %letter_count) { $repeat_found = 1 if $letter_count{$_} > 1; } print $word unless $repeat_found; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Coffee time quiz
by ChemBoy (Priest) on Oct 22, 2002 at 20:32 UTC | |
by sauoq (Abbot) on Oct 22, 2002 at 21:19 UTC | |
by locked_user mtve (Deacon) on Oct 29, 2002 at 14:17 UTC | |
by thelenm (Vicar) on Oct 22, 2002 at 20:42 UTC | |
by Anonymous Monk on Oct 24, 2002 at 10:42 UTC | |
|
Re: Coffee time quiz
by zigdon (Deacon) on Oct 22, 2002 at 20:22 UTC | |
|
Re: Coffee time quiz
by Bilbo (Pilgrim) on Oct 22, 2002 at 20:16 UTC | |
|
Re: Coffee time quiz
by Zaxo (Archbishop) on Oct 22, 2002 at 20:30 UTC | |
|
Re: Coffee time quiz
by runrig (Abbot) on Oct 22, 2002 at 20:26 UTC | |
|
Re: Coffee time quiz
by fglock (Vicar) on Oct 22, 2002 at 20:58 UTC | |
by Aristotle (Chancellor) on Oct 22, 2002 at 21:35 UTC | |
|
Re: Coffee time quiz
by robobunny (Friar) on Oct 22, 2002 at 20:40 UTC | |
by perlmoth (Hermit) on Oct 22, 2002 at 21:00 UTC | |
|
Re: Coffee time quiz
by rir (Vicar) on Oct 22, 2002 at 23:40 UTC | |
by BrowserUk (Patriarch) on Oct 23, 2002 at 02:12 UTC |