in reply to Re^2: Telnet & Text Capture to file
in thread Telnet & Text Capture to file

The Net::Telnet documentation, especially its synopsis shows the following code:

use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Prompt => '/bash\$ $/'); $t->open("sparky"); $t->login($username, $passwd); @lines = $t->cmd("who"); print @lines;

I interpret this code as

  1. logging on to a machine "sparky", with a username of $username and a corresponding password
  2. executing a command, who, and capturing its output in @output
  3. printing the captured output

I'm not sure where the synopsis of Net::Telnet diverges from your stated requirements, or where you've found flaws in the operation of Net::Telnet for your required operation, so I can't help you much further. If you have problems with writing the lines captured in @output to a file, consider looking at open and print, but neither of these have anything to do with a telnet connection.

Replies are listed 'Best First'.
Re^4: Telnet & Text Capture to file
by sonicscott9041 (Novice) on Jul 15, 2009 at 20:47 UTC
    Thank you. I will use the Net::Telnet.