+ my $rpri = $state_to_pri{$host_state{$r->{'Host'}}};
+ print STDERR "I: ... considering ", $r->{'Host'}, " (pri $rpri, lu ", $r->{'LastUpdate'}, ")\n" if $debug > 1;
+ next if $rpri > $pri;
+
+ if ($rpri < $bestpri ||
+ $rpri == $bestpri && $r->{'LastUpdate'} < $best->{'LastUpdate'}) {
+ # Trick: $best must be defined, as otherwise $bestpri == 99
+ $best = $r;
+ $besti = $i;
+ $bestpri = $rpri;
+ }
+ }
+
+ if (defined $besti) {