So my problem is that i have a perl5.8 installation and i can't install any additional module. (I am a public servant and i have to use the servers as they are without any right on it or choosing what i can install on it, the process to modify something take years).
So there is a little web server script :
use HTTP::Daemon;
use HTTP::Status;
(my $d = new HTTP::Daemon
LocalAddr => '127.0.0.1',
LocalPort => 52443
) || die;
print "Please contact me at: <URL:", $d->url, ">\n";
while (my $c = $d->accept) {
while (my $r = $c->get_request) {
if ($r->method eq 'GET' and $r->uri->path eq "/xyzzy") {
# remember, this is *not* recommended practice :-)
$c->send_file_response("D:/Script/index.html");
}
else {
$c->send_error(RC_FORBIDDEN)
}
}
$c->close;
undef($c);
}
And i would like to return a json like : {"Status" : "Ok" }
regards