X-Git-Url: http://git.shiar.net/barcat.git/blobdiff_plain/cdad4c9fc575cb94974ae27e451aed47fc072710..409c90c0c170f9d91ffaa2c22a2fdaa878bd8cb1:/barcat?ds=inline diff --git a/barcat b/barcat index 4c3cf8a..600f453 100755 --- a/barcat +++ b/barcat @@ -181,11 +181,13 @@ if ($opt{stat}) { $opt{hidemax} ||= @lines; printf '%s of ', sum(@values[$opt{hidemin} - 1 .. $opt{hidemax} - 1]) // 0; } - my $total = sum @order; - printf '%s total', $total; - printf ' in %d values', scalar @values; - printf ' (%s min, %*.*f avg, %s max)', - $order[-1], 0, 2, $total / @order, $order[0]; + if (@order) { + my $total = sum @order; + printf '%s total', $total; + printf ' in %d values', scalar @values; + printf ' (%s min, %*.*f avg, %s max)', + $order[-1], 0, 2, $total / @order, $order[0]; + } say ''; }