Hello world/Web server: Difference between revisions
m
→{{header|Perl}}: future-proof for 5.36, \xd -> \x0d, \xa -> \x0a
(→min: add) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: future-proof for 5.36, \xd -> \x0d, \xa -> \x0a) |
||
Line 1,481:
}</syntaxhighlight>
Using Perl's glue power, provide a
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\
"Goodbye, World! (hello, visitor No. $vn!)\
}</syntaxhighlight>
|