#!/usr/local/bin/perl # # This here is a trivial little CGI driver that # drives the Maze module. # # David Chess, chess@theogeny.com # http://www.davidchess.com/ # use strict; use Maze; srand(); my $m = new Maze(12,9); $ENV{QUERY_STRING} =~ /ascii/i ? do_ascii($m) : do_html($m); exit; sub do_html { my $m = shift; my $body = $m->display_html('../toys/'); print <<"EOD"; Content-type: text/html A Maze


$body


This maze brought to you by MazeToy.cgi, which uses the Maze module from David Chess's TOYS page.

EOD } sub do_ascii { my $m = shift; my $body = $m->display_ascii(); print <<"EOD"; Content-type: text/plain $body EOD }