Jump to content

Hello world/Web server: Difference between revisions

m
→‎{{header|Perl}}: future-proof for 5.36, \xd -> \x0d, \xa -> \x0a
(→‎min: add)
m (→‎{{header|Perl}}: future-proof for 5.36, \xd -> \x0d, \xa -> \x0a)
Line 1,481:
}</syntaxhighlight>
 
Using Perl's glue power, provide a suicide note
with visitor counter via netcat:
<syntaxhighlight 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\xdx0d\xax0a\xdx0d\xax0a",
"Goodbye, World! (hello, visitor No. $vn!)\xdx0d\xax0a";
}</syntaxhighlight>
 
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.