Try:
cmpthese (10, { a => sub { a( \@foo ) }, b => sub { b( \@foo ) }, });
You are trying to take a reference to a sub with arguments. That doesn't work. Try Data::Dumpering the result of \&a(\@foo). It is a reference to the arrayref that a() returns... ie. perl calls the sub, then creates a ref to the result, which in turn cmpthese() can't do much with.
In reply to Re: cannot get Benchmark to work
by fishbot_v2
in thread cannot get Benchmark to work
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |