Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Perl Telnet client not receiving all the data

by dasgar (Deacon)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2014-09-16 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (40 votes), past polls