in reply to Re^3: Trying to capture an error using NET::TELNET
in thread Trying to capture error message using telnet::net

Hi,

I did :

eval { my $telnet = new Net::Telnet ( Timeout=>10,Port => $console_por +t ,Errmode=>'die'); $telnet->open("$console_server"); }; warn "The server is unreacable? $@" if $@;

But got a lot of error like :
Global symbol "$telnet" requires explicit package name at ./connect_telnet.pl line 3
What can i do??

Replies are listed 'Best First'.
Re^5: Trying to capture an error using NET::TELNET
by blazar (Canon) on Sep 05, 2008 at 10:47 UTC

    Most probably, you're just not declaring $telnet in a sufficiently large scope: the code you pasted above, as of itself is fine.

    --
    If you can't understand the incipit, then please check the IPB Campaign.
Re^5: Trying to capture an error using NET::TELNET
by Anonymous Monk on Sep 02, 2008 at 12:08 UTC
    Fix it.