laziness, impatience, and hubris | |
PerlMonks |
Re^2: Net::SNMP::Interfaces how to print the error()by thanos1983 (Parson) |
on Jun 04, 2014 at 20:41 UTC ( [id://1088737]=note: print w/replies, xml ) | Need Help?? |
To: Mr. Muskrat, Thanks for the clarification part, I was not sure if I did understand correctly. Well in conclusion, by using the die command:
The output is:
By changing the code to:
The output is:
The whole point of my question was that I would like to see a printout like:
Which the actual output of TCPDUMP, in order to inform the user that the port or community or what ever the error is wrong. Both solutions indicate that the error comes from line 10 which is Net::SNMP::Interfaces request so there is an indication, I was just looking for something extra since the documentation said that there might give more information if the user include the RaiseError => 1 command. Update:By removing the RaiseError => 1 the (HASH %arg) like:
The error becomes:
Which points out to the array, which makes the user wonder what is the error, well in this case I would suggest to use one of the upper solutions so at least the user get's an idea of the error and not be looking at the wrong direction. Thank you all for your time and effort, replying to my question.
Seeking for Perl wisdom...on the process...not there...yet!
In Section
Seekers of Perl Wisdom
|
|