use strict; use warnings; package gs; sub long_strings_first($$) { length $_[1] <=> length $_[0] || lc $_[1] cmp lc $_[0] } sub long_strings_first_no_proto { length $_[1] <=> length $_[0] || lc $_[1] cmp lc $_[0] } package main; use Benchmark qw( cmpthese ); my @data; { open(my $data, '<', $0); local $/; @data = split(/\s+/, <$data>); } cmpthese(-3, { implicit => \&implicit, explicit => \&explicit, explicit_np => \&explicit_np, });