#! perl -slw
use strict;
my @words = do{ local @ARGV = 'words.txt'; <> };
chomp @words;
my $all = join ' ', @words;
my $start = time;
for my $i ( @words ) {
while( $all =~ m[ ([^ ]*$i[^ ]*) ]g ) {
my $j = $1;
next
if $j eq $i
or $j eq "${i}s"
or $j eq "${i}'s";
print "$j contains $i";
last; ## Added
}
}
printf STDERR "Took %d seconds for %d words\n",
time() - $start, scalar @words;
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|