Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Welcome to the monastery! :)
DISCLAIMER: I never used that module! But it's obvious that your use of exists on scalar values is weird. from this documentation of Net::Telnet ... > When mode is "return" then the method generating the error places an error message in the object and returns an undefined value in a scalar context and an empty list in list context. The error message may be obtained using errmsg(). ... I suppose you want to used defined instead. FWIW: Another way is to keep the error-mode "die" and to catch the exception with a surrounding block eval (that's a try-catch in newest Perl). Like that you'd get better diagnostics what went wrong. Hope this helps! :) Cheers Rolf In reply to Re: Perl Script to Test Telnet Connectivity
by LanX
|
|