#!/usr/bin/perl -w # server2.pl use strict; use IO::Socket; my $server = IO::Socket::INET->new( LocalPort => 8080, Type => SOCK_STREAM, Reuse => 1, Listen => 5) or die "$@\n"; my $client; while ( $client = $server->accept()){ my $method = ""; my $uri = ""; while(<$client>){ last if /^\r\n$/; if ( $_ =~ /^(GET|POST) (.*?) HTTP\// ){ $method = $1; $uri = $2; } } my $resp_html =< URI: $uri