use strict; use warnings; use Benchmark qw(cmpthese); my $x; my $y; sub bare { ++$x; $x } sub retn { ++$y; return $y } print "Perl version: $]\n\n"; cmpthese(25_000_000, { bare => sub {my $t = bare()}, retn => sub {my $t = retn()}, }); print "\n($x, $y)\n";