/t/helper/child-httpd.pl
http://github.com/perlbal/Perlbal · Perl · 18 lines · 11 code · 5 blank · 2 comment · 1 complexity · 28459fb646704d3b8e34e8da5aa47d2e MD5 · raw file
- #!/usr/bin/perl
- use strict;
- my $req = <>;
- die "Bogus request" unless $req =~ /^GET (\/\S*) HTTP\/1\.\d/;
- $| = 1;
- my $uri = $1;
- while (<>) {
- last unless /\S/;
- }
- my $response = "You wanted [$uri] and I am pid=$$\n";
- #warn "Response from pid $$: [$response]\n";
- my $len = length $response;
- print "HTTP/1.0 200 OK\r\nContent-Length: $len\r\n\r\n$response";