你的分享就是我们的动力 ---﹥

Perl 使用 telnet 登录到远程服务器

时间:2013-05-30 00:09来源:www.chengxuyuans.com 点击:

代码简介

暂无

Perl代码片段

use Net::Telnet;

$telnet = Net::Telnet->new
( 
    Timeout => 90,
    Prompt  => '%', 
    Host => 'server.com' 
);

$telnet->login('username', 'password');

$telnet->cmd("cd folder1");

@listing = $telnet->cmd("ls");

print "Here are the files:\n";
print "@listing";

$telnet->close;

转载注明地址:http://www.chengxuyuans.com/Perl/63114.html