#!/usr/bin/perl -w use IO::Socket; use strict; use FileHandle; use CGI; my $q = new CGI; #use CGI::Pretty; #my $q = new CGI::Pretty; $| = 1; print $q->header(-type => 'text/html'), $q->start_html(-bgcolor => '#ffffff', -title => 'Online Boggle Solver'); my $op = $q->param('op') || "unspecified"; print $q->h1("Onlne Boggle Solver"); if ($op eq "solve") { my ($remote, $line); $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "localhost", PeerPort => "12345", ) or die "sorry - cannot connect to boggle server. try again later."; $remote->autoflush(1); print $remote $q->param('board'); print $remote "%\n"; print qw!
!;
while ($line = <$remote>) {
print $line;
}
print qw!!;
$q->param('board' => "");
}
print $q->p, $q->hr, $q->p;
print $q->p("Just enter your desired boggle board in the box " .
"below, press 'solve', and all possible boggle responses will be" .
" displayed!");
print $q->start_form( -method => 'POST', -action => $q->url()) ,
$q->textarea ( -name => 'board', -rows => '6', -columns => '12',
-default=> "" ),
$q->submit( -name => 'op', -value => 'solve'),
$q->end_form();
print $q->p, $q->hr, $q->p("You can find out " .
$q->a({href=>"http://www.circlemud.org/~jelson/software/boggle.html"},
"more information about this program") . ", or its " .
$q->a({href=>"http://www.circlemud.org/~jelson"}, "creator") . ".");
print $q->p, $q->address("Last modified: 9 August 1999");
print $q->end_html();