http://qs321.pair.com?node_id=1202797

jvuman has asked for the wisdom of the Perl Monks concerning the following question:

When I access the hrPrinterDetectedErrorState OID (1.3.6.1.2.1.25.3.5.1.2.1) using the Net-SNMP command line tools, I get a string of two hex digits, like "0A 00". This can be interpreted as a bitmask using instructions in the HOST-RESOURCES mib.

However, when I retrieve this value using Net::SNMP, I always get a pair of ASCII space characters. Data::Dumper confirms this.

Example code:

my $oid = '1.3.6.1.2.1.25.3.5.1.2.1'; my ($snmp,$error) = Net::SNMP->session(...); my $result = $snmp->get_request(-varbindlist => [ $oid ]; print $result->{$oid},"\n";

Am I missing something? I get the same results on ActiveState Perl 5.24 on Windows and Perl 5.16 on Linux. Thank you for any suggestions!