Jump to content

Hello world/Web server: Difference between revisions

(→‎{{header|C}}: simplified code, dropped fork(), serving HTML5 (!))
Line 127:
"<html><head><title>Goodbye, world!</title></head><body>Goodbye, world!</body></html>\r\n";
close $client;
}</lang>
 
Using Perl's glue power, provide a suicide note with visitor counter via netcat:<lang Perl>while (++(our $vn)) {
open NC, "|-", qw(nc -l -p 8080 -q 1);
print NC "HTTP/1.0 200 OK\xd\xa",
"Content-type: text/plain; charset=utf-8\xd\xa\xd\xa",
"Goodbye, World! (hello, visitor No. $vn!)\xd\xa";
}</lang>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.