yarex has asked for the wisdom of the Perl Monks concerning the following question:
When wrong command is entered, normally telnet displays error message and prompt, but from Perl it does nothing. Input log is empty, output log is empty and dump log contains only following: > 0x00000: 31 35 0d 0a 15.. I dont know what else to try. Here is how looks normal telnet session output:use Net::Telnet (); my $conn = new Net::Telnet (TelnetMode => 0); unless ($conn->open(Host => $host, Port => 23)) { die "Error opening socket:: ".$conn->errmsg(); } print "Connected to ".$conn->host().", port ".$conn->port()."\n"; $conn->prompt('/...>/'); # prompt is 014> my $lines = $conn->put("15\r"); # command 15 to give me the site name my ($a,$b); ($a,$b) = $conn->waitfor(Match=>'/...>/',Timeout=>100); $conn->close;
Any help is appreciatedTrying xxx.xxx.xxx.xxx... Connected to xxx.xxx.xxx.xxx. Escape character is '^]'. 014>15 15 014 TMR Name 014>^] telnet> quit Connection closed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Issue with Net::telnet
by SuicideJunkie (Vicar) on Feb 10, 2015 at 20:51 UTC | |
by yarex (Initiate) on Feb 11, 2015 at 16:54 UTC | |
by yarex (Initiate) on Feb 12, 2015 at 17:12 UTC |