in reply to Re: Net::Telnet + command prompt
in thread Net::Telnet + command prompt

Solved! The code to do so is the following:

foreach $host (sort @hosts) { $t = new Net::Telnet (Timeout => 10, Input_log => $file, Prompt => "/\>/"); print "\n\nConnecting to $host ...\n"; $t->open("$host"); $t->login("abc","abc123"); my @lines = $t->cmd('dir'); print "$host: Directory Contents:\n"; print "@lines \n"; $t->close; }
Thanks to all for your help.

Replies are listed 'Best First'.
Re^3: RESOLVED: Net::Telnet + command prompt
by Anonymous Monk on Mar 06, 2014 at 15:47 UTC
    Hi everyone, I'm trying to connect through telnet to windows ce, but the prompt is "\> " I don't can to send commands because I've this error: pattern match read eof at telnettest.pl line 185"" please someone who can help me!!!
      Hey check if the host to which you are trying to telnet is accepting connections. This generally occurs when the telnet connection cannot be established.