Welcome to the Monastery | |
PerlMonks |
Re: Use hash variable as constantby kcott (Archbishop) |
on Jun 27, 2014 at 15:50 UTC ( [id://1091489]=note: print w/replies, xml ) | Need Help?? |
G'day Virus2500, Welcome to the monastery. "... which i want to get "translated" by Net::SNMP." You may find some of these (from Net::SNMP's documentation) useful:
"However afaik Net::SNMP translates the bareword INTEGER into an integer value... right?" You can find the answer to this by tracking back through the code. Doing so will likely increase your understanding of the module and how it works. From source code for Net::SNMP v6.0.1:
From source code for Net::SNMP::PDU v6.0.1:
[See Exporter - Exporting Without Using Exporter's import Method for export_to_level() doco.] From source code for Net::SNMP::Message v6.0.1:
I'll leave you to explore further ... [While reviewing this source code, also look at sub prepare { ... }), which contains the source of your error message (i.e. $_[0]->_error('The ASN.1 type "%s" is unknown', $_[1])).] "ERROR: The ASN.1 type "OCTET_STRING" is unknown" Net::SNMP exports the symbol OCTET_STRING by default. The same is true for INTEGER. From source code for Net::SNMP v6.0.1:
Below this, are other ways to import them:
[See also: Net::SNMP - EXPORTS] Check how you are loading Net::SNMP; compare that with Net::SNMP - EXAMPLES. -- Ken
In Section
Seekers of Perl Wisdom
|
|