It often irritates me that I can't supply a coderef to the Benchmark::
routines: here's a small patch to allow them.
p5p-msgid:
199703041132.LAA07613@tyree.iii.co.uk
last if $pack ne $curpack;
}
- my $subcode = "sub { package $pack; my(\$_i)=$n; while (\$_i--){$c;} }";
+ my $subcode = (ref $c eq 'CODE')
+ ? "sub { package $pack; my(\$_i)=$n; while (\$_i--){&\$c;} }"
+ : "sub { package $pack; my(\$_i)=$n; while (\$_i--){$c;} }";
my $subref = eval $subcode;
croak "runloop unable to compile '$c': $@\ncode: $subcode\n" if $@;
print STDERR "runloop $n '$subcode'\n" if ($debug);