Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Perl Telnet client not receiving all the data

by dasgar (Priest)
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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059731]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2018-01-17 11:41 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (198 votes). Check out past polls.