Originally Posted By: RusselB
Good catch on the inc/dec error. In fact, with it starting at the maximum, then increasing, it would only run once, not forever.

I recommended using $hfind rather than $hget to save you from having to loop through the dns hash table each time. In this case, $hfind is more efficient than $hget since it incorporates the search rather than having to get the item then compare it.

The hadd (before altering the code) was always processed so that any remaining dns values that were in the match string, but not the dns table would be maintained.


Yup, with dec and counting down it would only run once, but with inc it was going to run forever.

In my code it only did hadd if the item name didn't also exist in the dns table. If it didn't then and only then it would remove the orphan ip data value and profess the hadd, all in one line. (I see you changed your code to only hadd when the data was changed, instead of always hadd.)

Also, shouldn't %ip.data = $hget(iptracker,%a) be

%ip.data = $hget(iptracker,%a).data

or

%ip.data = $hget(iptracker,%ip.item)

???