in reply to Re^4: SNMP MIB files...
in thread SNMP MIB files...
You could extend the SNMP class to add your needed code to the mib loading method and then SUPER:: it. This would probably be more work than adding the few lines you need.
Also, you probably ought to avoid that `ls` construction and go with readdir ...
$root="/usr/local/share/snmp/mibs/TEMP"; opendir(DIR, $root) || die "can't opendir $root: $!"; map { &SNMP::addMibDirs($_); } grep { ! /^\./ && -d "$root/$_" } readdir(DIR); closedir DIR;
Which also avoids accidentally trying to add files as MibDirs and is safer and more portable.
|
|---|