Do you have a question? Post it now! No Registration Necessary. Now with pictures!
April 18, 2006, 1:15 pm
rate this thread
I 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.
my $dumplog = "dumplog.txt";
my $outputlog = "outputlog.txt";
my $telnet = new Net::Telnet(Timeout => 10,
Errmode => 'die',
Dump_Log => "$dumplog",
output_log => "$outputlog",
$telnet->waitfor('/ixlourd\@e2epia2: $/') ;
print "Before ls";
my @lines =$telnet->cmd("who");
$telnet->waitfor('/ixlourd\@e2epia2: $/') ; # getting comamndtimed
out error here..
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
Can i use sleep insted of waitfor for time beeing.