#!/usr/bin/perl -w use strict; use Benchmark qw(cmpthese); my @words = qw(The time has come the Walrus said to speak of many things); cmpthese(-3, { st => q{ my @sorted = map { $_->[1] } sort { $a->[0] <=> $a->[0] || $a->[1] cmp $b->[1] } map { [ tr/eE/eE/, $_ ] } @words; }, grt => q{ my @sorted = map { substr($_, 4) } sort map { pack("LA*", tr/eE/eE/, $_) } @words; }, bare => q{ my @sorted = sort { ($a =~ tr/eE/eE/) <=> ($b =~ tr/eE/eE/) } @words; } });