stevieb has asked for the wisdom of the Perl Monks concerning the following question:
While doing a benchmark between a C implementation of some file work to a pure Perl implementation, I found what I think might be an issue in Benchmark cmpthese, whereby it seems to remove a . character from input param to the subs being tested.
Here's an extremely minimalistic version that demonstrates the issue:
use warnings; use strict; use Benchmark qw(:all); my $fname = 'a.txt'; cmpthese( 1, { p_read => "p_read($fname)", }); sub p_read { my $fname = shift; print "$fname\n"; } __END__ atxt # cmpthese output redacted
This happens with Benchmark v1.12 on perl v5.14.4 and Benchmark v1.2 on perl v5.22.1.
Have I overlooked something in the docs perhaps that anyone knows about?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Benchmark cmpthese() removing '.' char from input param
by dave_the_m (Monsignor) on Mar 12, 2016 at 16:10 UTC | |
by stevieb (Canon) on Mar 12, 2016 at 16:16 UTC | |
Re: Benchmark cmpthese() removing '.' char from input param
by 1nickt (Canon) on Mar 12, 2016 at 16:07 UTC |
Back to
Seekers of Perl Wisdom