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

Dear Monks,

Here goes:

We have around 3000 routers and a configuration database with entries created when the devices are commissioned. In order to ensure the integrity and accuracy of the recorded data I have a bash shell script that grabs the list of all devices and a few config variables (such as community strings, device type, line speed etc) and then double checks the validity of the config against the live device settings.

I am in the process of converting to Perl (from the original, and very slow bash script).

Now, it has taken me a little while to get the referencing / dereferencing syntax working correctly but this seems OK now.

My questions:

1. When I use Data::Dumper to get the contents of \$results_table the sysbojid and snmp_status variables seem to have zapped the rest of the data on the HoH for that site out of existence. Is the syntax incorrect? If I remove the sysobjid => unknown code then any site that is down (i.e. has its snmp allowed managers configured incorrectly) retains the line_speed / mgmt_ip data correctly.

2. Is using a HoH an appropriate approach? My thoughts were to use a HoH so that when I have all of the data I can chuck out all of the relevant HTML pages quite easily.

FYI - Using non-blocking Net::SNMP has reduced the runtime of this from around 20-30 minutes for the shell script (which ran serially) to around 24 seconds (WoooHooo!)

I think you're making life overly complicated for yourself by passing $group and $sitename by reference. If you omit the backslashes from before them in the -callback line and then use single rather than double dollar signs inside store_sysobjid everything should still work.