puzzle.cgi
use CGI qw(:standard);
$query = new CGI;
if (param())
{
$in = param("in");
}
$in =~ s/^\s*//;
$in =~ s/\s*$//;
$in_word = "\^$in\$";
print $query->header('text/html');
print "<HEAD><TITLE>Crossword puzzle helper</TITLE><HEAD>
<BODY><CENTER><H3>Crossword puzzle helper</H3></CENTER>\n";
print "<PRE><FONT SIZE=+1 COLOR=red><B>Matches for $in</FONT>\n\n";
open(GREP,"-|") || exec "/bin/grep", "-i" ,$in_word, "/usr/share/dict/words";
while (<GREP>)
{
print "$_";
}
close GREP;
print "</PRE>\n";
print $query->end_html;