brwarn has asked for the wisdom of the Perl Monks concerning the following question:
The code:Connecting to baby ... timed-out waiting for command prompt at stopserver.pl line 28
The input log:use Warnings; use Net::Telnet (); use Cwd; $file="inputLog.txt"; $ofile="outputlog.txt"; # build an array of the servers we want to talk to @hosts = ("scary", "baby", "posh"); foreach $host (sort @hosts) { $t = new Net::Telnet (Timeout => 10, Input_log => $file, Output_log => $ofile); print "\nConnecting to $host ...\n"; $t->open("$host"); $t->login(abcde,abc123); my @lines = $t->cmd('ls'); print "$host: Directory Contents:\n"; print "@lines \n"; $t->close; }
Welcome to Microsoft Telnet Service login: abcde password: *=============================================================== Welcome to Microsoft Telnet Server. *=============================================================== C:\Documents and Settings\Administrator>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::Telnet + command prompt
by NetWallah (Canon) on Mar 06, 2008 at 20:19 UTC | |
|
Re: Net::Telnet + command prompt
by regexes (Hermit) on Mar 07, 2008 at 10:12 UTC | |
by brwarn (Novice) on Mar 07, 2008 at 17:43 UTC | |
by Anonymous Monk on Mar 06, 2014 at 15:47 UTC | |
by Anonymous Monk on Mar 11, 2014 at 11:02 UTC |