From d598cef23bd608fe31ab6055c3ab087b1e23920e Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Tue, 4 Nov 2003 16:50:25 -0800 Subject: Re: [perl #24398] Benchmark.pm cmpthese segfault Message-ID: <3FA8B9D1.2020806@stason.org> p4raw-id: //depot/perl@21671 --- lib/Benchmark.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Benchmark.pm') diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm index c472d58ffd..6129828f96 100644 --- a/lib/Benchmark.pm +++ b/lib/Benchmark.pm @@ -890,7 +890,7 @@ sub cmpthese{ @vals = sort { $a->[7] <=> $b->[7] } @vals; # If more than half of the rates are greater than one... - my $display_as_rate = $vals[$#vals>>1]->[7] > 1; + my $display_as_rate = @vals ? ($vals[$#vals>>1]->[7] > 1) : 0; my @rows; my @col_widths; -- cgit v1.2.1