# Well, I see bunches of other people posting their solutions to the
# regular quiz, so here's mine:
# 
#!/usr/bin/perl

$SEG_LENGTH = 4;

while (<>) {
   chomp;
   next if /\W/;		
   $w = lc $_;
   %w = map { substr($w,$_,$SEG_LENGTH) => 1 } 0..length($w)-$SEG_LENGTH;
   for $w (keys %w) { $wordmap{$w} = exists $wordmap{$w} ? undef : $_; }
}

open(Q,">questions") or die;
open(A,">answers") or die;
for (sort keys %wordmap) {
   next unless defined $wordmap{$_};
   print Q "$_\n";
   print A "$wordmap{$_}\n"
}
close Q; close A;

__END__

-Scott
-- 
Jonathan Scott Duff
duff@cbi.tamucc.edu
