#!/usr/bin/perl print "Content-type:text/html\r\n\r\n"; print "

Welcome to The Dip.
Where would you like to go, North or South?

"; &getFormData; $val; $val = "$request{'make'}"; $num = rand(5); $int = int($num); $pic; #print " ".$int; if($val =~ m/North/i){ $im = "im.jpg"; $pic = "north"; $mess = "you are now in the Northern part of the Dip"; } if($val =~ m/south/i){ $im = "im2.jpg"; $pic = "south"; $mess = "you are now in the southern end of the Dip"; } print << "DOC"; $pic


DOC $hello = "$request{'hiddenfield'}"; print "
"; print "
"; print $val; print "
"; print $mess; sub getFormData { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/\n/ /g; $request{$name} = $value; } }