perl模块IO::Socket的例子,从远程服务器上读取数据,只取第一行数据。
代码:
#!/usr/bin/perl # use IO::Socket;
my $server = "localhost"; my $fh = IO::Socket::INET->new($server); my $line = <$fh>; print $line;
CopyRight © 2010-2021 脚本学堂 Jb200.com , All Rights Reserved.