Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Perl Telnet client not receiving all the data

by dasgar (Curate)
on Oct 25, 2013 at 18:41 UTC ( #1059731=note: print w/ replies, xml ) Need Help??

in reply to Perl Telnet client not receiving all the data

Just to expand on keszler's response.

Here how I would approach this. First, manually run a telnet client and step through everything that you want your script to do. Make notes of what commands you are issuing and what text is being shown that lets you know that the telnet server is ready for the next command.

Next, change your 'prompt' argument for the Net::Telnet's new method call to be /Option :/ (as keszler suggested) or /Select Option :/. Then when you issue a command to the telnet server, you can use the 'cmd' method. If you know what the next prompt looks like and it's different than what is specified in the 'new' method when you opened the connection, you can tell the 'cmd' method to use a different regex value for prompt. (i.e. my $resp = $t->cmd(String => '4', Prompt => 'Current Password:');)

Also, based on the posted content of your dumpfile, I think that you do want to set 'binmode' to 1.

Comment on Re: Perl Telnet client not receiving all the data
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059731]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-05-25 22:07 GMT
Find Nodes?
    Voting Booth?