From: SADAHIRO Tomoyuki Date: Wed, 22 Nov 2006 22:32:46 +0000 (+0900) Subject: Re: [perl #40917] Benchmark fails under -Mbignum X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=72372890cb3d5f560a85287c60add9dd2f711a62;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #40917] Benchmark fails under -Mbignum Message-Id: <20061122223227.193E.BQW10602@nifty.com> p4raw-id: //depot/perl@29348 --- diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm index 24e3390..bc40d2d 100644 --- a/lib/Benchmark.pm +++ b/lib/Benchmark.pm @@ -161,7 +161,7 @@ The routines are called in string comparison order of KEY. The COUNT can be zero or negative, see timethis(). -Returns a hash of Benchmark objects, keyed by name. +Returns a hash reference of Benchmark objects, keyed by name. =item timediff ( T1, T2 ) @@ -225,6 +225,8 @@ c can also be passed the data structure that timethese() returns: cmpthese( $results ); in case you want to see both sets of results. +If the first argument is an unblessed hash reference, +that is RESULTSHASHREF; otherwise that is COUNT. Returns a reference to an ARRAY of rows, each row is an ARRAY of cells from the above chart, including labels. This: @@ -435,7 +437,7 @@ our(@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); clearcache clearallcache disablecache enablecache); %EXPORT_TAGS=( all => [ @EXPORT, @EXPORT_OK ] ) ; -$VERSION = 1.08; +$VERSION = 1.09; # --- ':hireswallclock' special handling @@ -881,7 +883,8 @@ USAGE sub cmpthese{ my ($results, $style); - if( ref $_[0] ) { + # $count can be a blessed object. + if ( ref $_[0] eq 'HASH' ) { ($results, $style) = @_; } else {