http://www.perlmonks.org?node_id=1059731


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.