in reply to Re^7: Advice on transforming a sub into a re-entrant recursive-able method.
in thread Advice on transforming a sub into a re-entrant recursive-able method.

Admittedly the OIDs and interface name are embedded due to laziness. Usually I have a config.pm that sets global constants and refer to them as $config::interface_oid_base ot some such whosy-whatsit.

The mapped grep is a great idea, what are your thoughts on making $device the returned list of interfaces available on the device? At my current skill level, I would create a global hash, iterate of the results executing your variant of &snmp_get to return the values. setting the value of $host_interfaces{$device_name}=>($snmpe_result)[0];
Assuming that an array was returned of course.

  • Comment on Re^8: Advice on transforming a sub into a re-entrant recursive-able method.