Net-SNMP version 5.4.3 (debian package: libsnmp-perl version 5.4.3~dfsg-2) on fresh debian squeeze install
Make sure all mibs are installed with snmp-mibs-downloader. Then:
~> perl -MSNMP -e 'SNMP::initMib(); SNMP::loadModules("ALL")' 2> stderr.txt
~> ls -l stderr.txt
-rw-r--r-- 1 pvm pvm 898 Jan 18 09:30 stderr.txt
~> cat stderr.txt
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Undefined OBJECT-GROUP (diffServMIBMultiFieldClfrGroup): At line 2195 in /usr/share/mibs/ietf/IPSEC-SPD-MIB
Undefined OBJECT-GROUP (diffServMultiFieldClfrNextFree): At line 2157 in /usr/share/mibs/ietf/IPSEC-SPD-MIB
Undefined OBJECT-GROUP (diffServMIBMultiFieldClfrGroup): At line 2062 in /usr/share/mibs/ietf/IPSEC-SPD-MIB
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Expected "::=" (RFC5644): At line 493 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Expected "{" (EOF): At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad object identifier: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad parse of OBJECT-IDENTITY: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
The fact that debian's standard mib install has erros, is a separate problem and not the reason for this bug. The bug is that perl libraries should not print directly to STDERR!
There is a workaround / HACK for a similar Net-SNMP bug in bug 3408007: https://sourceforge.net/tracker/?func=detail&aid=3408007&group_id=12694&atid=112694. The workaround (for that bug - modify as needed) is found here: https://gist.github.com/1210984
See Patch #1285 Added logging primitives to perl bindings for a better way to deal with this.