#!c:/perl/bin/perl.exe use CGI; use strict; use CGI::Session; use CGI::Cookie; use Storable; my $q=new CGI; my $sesid=$q->cookie('id') || undef; my $ses=CGI::Session->new('driver:File;serializer=Storable;id:MD5',$sesid,{Directory=>'/tmp'}); $sesid=$ses->id; my $cookie=$q->cookie(-name=>'id',-value=>$sesid,-expires=>"+1m"); my $phase=$ses->param('phase') || 1; my ($x,$y); if ($phase < 3) { my @keys=$q->keywords; my $params=split(/\,/,shift(@keys)); ($x,$y)=@_; } $ses->param('phase',$phase); if ($phase==1) { $ses->param('x1',$x); $ses->param('y1',$y); } elsif ($phase==2) { $ses->param('x2',$x); $ses->param('y2',$y); } print $q->header(-cookie=>$cookie),$q->start_html; print "Phase: $phase
X: $x
Y: $y
\n"; if ($phase==1) { print ""; print "" if $phase==1; print $q->end_html;