Perl 编写的一个简单 Web 服务器

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

use HTTP::Daemon;  

$HTTPserver = HTTP::Daemon->new(Timeout => 600);

print "My URL is: ", $HTTPserver->url, ".\n";

while ($HTTPclient = $HTTPserver->accept) {
    $HTTPclient->autoflush(1);
    print $HTTPclient 
'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<TITLE>Welcome to my Web server!</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>Welcome to my Web server!</H1>
</CENTER>

</FORM>

</BODY>

</HTML>';

$HTTPclient->close;
}