## see my posted text... ## if ($current_time > $next_cleanup_due) #only every 5+ minutes ## { ## run through all key,values of %time and dump_data() ## for all %time values that have "expired"... ## probably need to add special kind of EOE message ## } cleanup() if ($current_time > $next_cleanup_due); sub cleanup { $next_cleanup_due += 6*60; # 6 minutes from now foreach my $node_audit (keys %time_out) { if ($current_time > ($time_out{$node_audit} + $time_out)) { push @{$data{$node_audit}}, "type=EXPIRED"; dump_data ($node_audit); } } }