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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |