www.pudn.com > filecollector.rar > telnet.pl


#!/usr/bin/env perl

use Net::Telnet;
use Data::Dumper;

my $ip = "133.197.19.2";
my $usr = "wangguan";
my $pass = "wangguan";

my $telnet_hdl=new Net::Telnet (Timeout => 1800, Prompt => '/[\$%#>:]\s*$/');

        $telnet_hdl->open(Host=>$ip,Timeout=>60);
        $telnet_hdl->login($usr, $pass);

my @csh = $telnet_hdl->cmd("which csh");
print Dumper(\@csh);