Hello world/Web server: Difference between revisions

Content added Content deleted
(Added Perl implementation)
m (→‎{{header|Perl}}: changed message to HTML and added HTTP status code)
Line 130: Line 130:


while( accept(CLIENT, SOCK) ){
while( accept(CLIENT, SOCK) ){
print CLIENT "Goodbye, world!";
print CLIENT "HTTP/1.1 200 OK\r\n" .
"Content-Type: text/html; charset=UTF-8\r\n\r\n" .
"<html><head><title>Goodbye, world!</title></head><body>Goodbye, world!</body></html>\r\n";
close CLIENT;
close CLIENT;
}</lang>
}</lang>