use Benchmark (); sub argless { $a cmp $b } sub proto($$) { $_[0] cmp $_[1] } sub args { $_[0] cmp $_[1] } my @array = qw( Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. ); Benchmark::cmpthese(0, { inline => sub { my @sorted = sort { $a cmp $b } @array; }, argless => sub { my @sorted = sort argless @array; }, proto => sub { my @sorted = sort proto @array; }, args => sub { my @sorted = sort { args($a, $b) } @array; }, }); __END__ Rate args proto argless inline args 4634/s -- -57% -63% -81% proto 10735/s 132% -- -14% -57% argless 12462/s 169% 16% -- -50% inline 24920/s 438% 132% 100% --