Skip to content

Instantly share code, notes, and snippets.

@scooby
Created February 8, 2009 05:34
Show Gist options
  • Save scooby/60215 to your computer and use it in GitHub Desktop.
Save scooby/60215 to your computer and use it in GitHub Desktop.
sub score {
return length($_[0]) > 8 ? 8 - length($_[0]) : length($_[0]);
}
my @s;
for my $o (`iconv -l`) {
chomp $o;
my(@aliases) = map(uc, split(/ /, $o));
tr/A-Z0-9//cd for @aliases;
print((sort { score($b) <=> score($a) } @aliases)[0] . ": $o\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment