You have two possible solutions here (at the very least):

1.) Net::Telnet (which can be found here)
Or
2.) Using IO::Socket to build a socket connection and do the socket data-negotiation manually.

Personally, I'd opt for the first solution, since Net::Telnet has been around for a while. In addition to Net::Telnet, you might also consider Net::SSH if you have the ability to do so.

IO::Socket is good to use if you need to define what type of data needs to be passed back and forth (for example, RPC). If you just want to telnet to a box, run a few commands, capture output, and print it to file, you are shooting yourself in the foot (9 times out of 10) by not using Net::Telnet.

Theodore Charles III
Network Administrator
Los Angeles Senior High
4650 W. Olympic Blvd.
Los Angeles, CA 90019
323-937-3210 ext. 224
email->secon_kun@hotmail.com
perl -e "map{print++$_}split//,Mdbnr;"

In reply to Re: Socket connection problem by Necos
in thread Socket connection problem by Draff

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.