Telnet problem -getting timed out error -
am 18.04.2006 15:15:52 von kishore.konjetiI am trying to connect unix server from windows xp installed with
perl5.8 activestate build.
I am getting error "command timed-out at C:\Perl\tel.pl line ..." while
executing who command. I am trying to solve this from many days.
How can i get output of telnet screen ... any unix command like ls or
cat ... currently i had taken who command.
The code is like this: out put of dumplog and outputlog.txt are
explained after code.
use Net::Telnet;
my $dumplog = "dumplog.txt";
my $outputlog = "outputlog.txt";
my $telnet = new Net::Telnet(Timeout => 10,
Errmode => 'die',
Dump_Log => "$dumplog",
output_log => "$outputlog",
);$telnet->open("e2epia2.uswc.uswest.com");
$telnet->waitfor('/login: $/i');
# $telnet->output_record_separator("\n");
$telnet->print("ixlourd") ;
$telnet->waitfor('/password: $/i');
$telnet->print("qwest1") ;
sleep( 5);
$telnet->waitfor('/ixlourd\@e2epia2: $/') ;
print "Before ls";
sleep(5);
my @lines =$telnet->cmd("who");
$telnet->waitfor('/ixlourd\@e2epia2: $/') ; # getting comamndtimed
out error here..
sleep(10);
print @lines;
$telnet->close;
****
When i opened dumplog.txt it is showing correctly with leftside
hexadicimal code and right side equelent english output of who. and
outputlog conatains username,password, and who words only.
But why it is not getting printing in screen through print. any output
record saperator ..
some fundemental concept i am missing. any body correct my code to work
fine.
Can i use sleep insted of waitfor for time beeing.