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


in reply to use telnet to connect to tcp session and receive data

Unless you're connecting to an actual Telnet server, you should probably use IO::Socket::INET.
  • Comment on Re: use telnet to connect to tcp session and receive data

Replies are listed 'Best First'.
Re^2: use telnet to connect to tcp session and receive data
by derby (Abbot) on Jun 22, 2005 at 14:51 UTC

    Not really. From the Net::Telnet:

    Other reasons to use this module than strictly with a TEL­NET port are:
    
      · You're not familiar with sockets and you want a simple way to make client connections to TCP services.
      
      · You want to be able to specify your own time-out while connecting, reading, or writing.
    
      · You're communicating with an interactive program at the other end of some socket or pipe and you want to wait for certain patterns to appear.
    

    When debugging, I use the command line telnet to connect to all types of servers (http, smtp, etc). There's no reason why you cannot use Net::Telnet the same way.

    -derby
      yea.. I figured.. either works however when I use a simple inet socket connection there's a lot of garbage in front of the text which leads me to believe there are format codes in the message. Leads me to think it's in vt100 mode or something. I guess I may have to use net::telnet after all