diff --git a/misc/maintenance/touch_all_biblios.pl b/misc/maintenance/touch_all_biblios.pl index 8d65f21eed..11425977bb 100755 --- a/misc/maintenance/touch_all_biblios.pl +++ b/misc/maintenance/touch_all_biblios.pl @@ -101,7 +101,7 @@ close($fh); # Benchmarking my $endtime = time(); my $time = $endtime-$startime; -my $accuracy = ($goodcount / $totalcount) * 100; # this is a percentage +my $accuracy = $totalcount ? ($goodcount / $totalcount) * 100 : 0; # this is a percentage my $averagetime = 0; $averagetime = $time / $totalcount if $totalcount; print "Good: $goodcount, Bad: $badcount (of $totalcount) in $time seconds\n"; diff --git a/misc/maintenance/touch_all_items.pl b/misc/maintenance/touch_all_items.pl index dbf1609221..7bdc423e14 100755 --- a/misc/maintenance/touch_all_items.pl +++ b/misc/maintenance/touch_all_items.pl @@ -110,7 +110,7 @@ close($fh); # Benchmarking my $endtime = time(); my $time = $endtime-$startime; -my $accuracy = ($goodcount / $totalcount) * 100; # this is a percentage +my $accuracy = $totalcount ? ($goodcount / $totalcount) * 100 : 0; # this is a percentage my $averagetime = 0; $averagetime = $time / $totalcount if $totalcount; print "Good: $goodcount, Bad: $badcount (of $totalcount) in $time seconds\n";