http://www.perlmonks.org?node_id=250434


in reply to Benchmark tips
in thread Making a match

WRT suggestion 1: just thought I should mention that I was, of course, far too Lazy to actually align them myself:
use List::Util 'max'; sub align { my ($hash) = @_; my $len = max map length, keys %$hash; $hash->{sprintf "%${len}s", $_} = delete $hash->{$_} for keys %$hash; return $hash; } cmpthese(10000, align { 'Bacon, Lettuce, & Tomato' => sub {...}, 'Ham on Rye' => sub {...}, 'Spam' => sub {...}, # etc. });