use Data::Dumper; use Benchmark; $r = timethese ( 10157, foo => sub { func1(@args) }, bar => sub { $ref->(1,2,3) }, ); print Dumper($r) $VAR1 = { 'foo' => bless( [ 0, '0.0200000000000005', 0, 0, 0, 10157 ], 'Benchmark' ), 'bar' => bless( [ 4, '4.22', '0.01', 0, 0, 10157 ], 'Benchmark' ) }; #### $r->{bar}->[1] == 4.22