Perl 一个超级简单的Socket服务器

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

#!/usr/bin/perl
use warnings;
use strict;
use IO::Socket;
# queue up no more than 5 pending clients
my $serv = IO::Socket::INET->new(LocalPort => 9876,Listen => 5); 
while(my $client = $serv->accept()) { #somebody connected!
    print $client "The time is now: ".scalar(localtime(time()))."\n";
    close $client;
}