+ # clear out the cache periodically to stop it growing for ever.
+ if ($main::systime - $lasttime >= 15*60) {
+ if (isdbg('prefix')) {
+ my $percent = $hits * 100 / $matchtotal;
+ dbg("Prefix Cache Cleared, Hits: $hits of $matchtotal = $percent\%")
+ }
+ my $percent = $hits * 100 / $matchtotal;
+ dbg("Prefix Cache Cleared, $percent\% hits") if isdbg('prefix');
+ %cache =();
+ $lasttime = $main::systime;
+ $hits = $matchtotal = 0;
+ }
+