in reply to I fear my code is unreadable
It's a lot longer, but it scans quickly, and if you need to come back and modify one of the steps it will be obvious where to do it.our $PADDING = 2; # config, so probably belongs at top of file my @phrases = ( keys %lists, map { @{$_} } values %lists ); my @lengths = map { length($_) } @phrases; @lengths = sort { $b <=> $a } @lengths; my $longest = shift @lengths; return $longest + $PADDING;
|
|---|