Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Net::SNMP::Interfaces how to print the error()

by hexcoder (Deacon)
on Jun 04, 2014 at 13:41 UTC ( #1088640=note: print w/replies, xml ) Need Help??


in reply to Net::SNMP::Interfaces how to print the error()

error is a method of this module, so I guess its
Net::SNMP::Interfaces::error()
instead of
$Net::SNMP::Interfaces::error

Replies are listed 'Best First'.
Re^2: Net::SNMP::Interfaces how to print the error()
by hexcoder (Deacon) on Jun 04, 2014 at 13:52 UTC
    O sorry, my mistake in the previous post.
    $Net::SNMP::Interfaces::error _is_ also a variable, but it is only set when RaiseError is set to a false value (which is not the case here).

    So either set RaiseError to a true value (like '1' or 'True') and let it die with the error message
    or set RaiseError to a false value (like undef) and then use your own die with $Net::SNMP::Interfaces::error.

      To: hexcoder,

      Well I tried both solutions by miss using the port option (1 or TRUE), but the result is the same.

      This is the reason that I am curious. My code works fine, but it would be nice to see for example wrong Port or this port is not responding. Something that can assist the user to understand the error.

      Thank you for your time and effort replying to my question.

      Seeking for Perl wisdom...on the process...not there...yet!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1088640]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2020-08-15 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (78 votes). Check out past polls.

    Notices?