I never said to use Errmode=>"return" .. I said to read the docs and pay attention to every mention of Errmode. If you want to use Errmode=>"return" that's fine, but there are several other options.

Since you didn't post any runnable code, no one can even begin to help you figure out why it's not working the way you want, we can only guess. Me, I spent about 2 minutes writting this, which seems to me to work just fine, so I have no idea what your problem is....

#!/usr/local/bin/perl -l use strict; use warnings; use Net::Telnet; sub t { return scalar(localtime) . " - "; } print t(), "Starting"; my $tel = new Net::Telnet(); $tel->open(Host=>'www.yahoo.com', Port=>9000, Timeout=>10, Errmode=>'return') or print t(), "Couldn't Open: ", $tel->errms +g(); print t(), "Timed Out: ", $tel->errmsg() if $tel->timed_out(); print t(), "still going strong"; __END__ laptop:~> monk.pl Tue Aug 10 23:56:32 2004 - Starting Tue Aug 10 23:56:43 2004 - Couldn't Open: problem connecting to "www.y +ahoo.com", port 9000: connect timed-out Tue Aug 10 23:56:43 2004 - Timed Out: problem connecting to "www.yahoo +.com", port 9000: connect timed-out Tue Aug 10 23:56:43 2004 - still going strong laptop:~>

In reply to Re^3: Net::telnet difficulty by hossman
in thread Net::telnet difficulty by mosh

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.