Mark
asked on
Put query string from URL request - PERL HTTP Daemon
I want to be able to call for example:
127.0.0.1:8000/?abc=123
And get the value of 'abc' printed to the console..
127.0.0.1:8000/?abc=123
And get the value of 'abc' printed to the console..
##!/usr/bin/perl
use HTTP::Daemon;
use Data::Dumper;
my $d = HTTP::Daemon->new(
LocalPort => 8000
) || die;
while (my $c = $d->accept) {
while (my $request = $c->get_request) {
print $request->url->path();
my $response = HTTP::Response->new( 200, 'OK');
$response->header('Content-Type' => 'text/html'),
$response->content("Ack");
$c->send_response($response);
$c->close;
exit;
}
}
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER