in reply to Net::Telnet: how to detect an empty line...
Does it respond when you send it commands? Then you can just assume that you have a 'prompt' if you get connected to it. Send a command and wait for a response. Then send the next command, etc. Here's how it could work using IO::Socket::INET:
use IO::Socket::INET; my $s = new IO::Socket::INET(PeerAddr => ..., PeerPort => ..., Proto = +> 'tcp'); unless ($s) { die "unable to connect..." } # we are connected, so just start sending commands print $s "first command\r\n"; my $resp = <$s>; # expect one line response print $s "second command\r\n"; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::Telnet: how to detect an empty line...
by s2cuts (Acolyte) on Feb 27, 2008 at 04:41 UTC | |
by pc88mxer (Vicar) on Feb 27, 2008 at 05:40 UTC | |
by s2cuts (Acolyte) on Feb 27, 2008 at 06:34 UTC | |
by Corion (Patriarch) on Feb 27, 2008 at 07:02 UTC |