use HTTP::Daemon; use HTTP::Status; use SVG; my $d = new HTTP::Daemon; print "Please contact me at: url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { my $svg = SVG->new(width=>'100%',height=>'100%'); my $g = $svg->group(id=>'group-1'); $g->circle(id=>'circle-1', cx=>int(rand(400)), cy=>int(rand(400)), r=>int(rand(100)),); if ($r->method eq 'GET') { my $path = $r->url->path; $path =~ /\/(.+)/; $sessionid = $1 || '00'; $g->text(x=>int(rand(400)), y=>int(rand(400))) ->cdata($sessionid); $c->send_response($svg->xmlify()); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }