Created
September 4, 2015 11:24
-
-
Save Altreus/e42c1ae6da2164bef85e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use 5.014; | |
my $letters = lc sort_letters(shift); | |
my $dict = shift // '/usr/share/dict/words'; | |
open my $words_in, '<', $dict; | |
while (<$words_in>) { | |
say if lc(sort_letters($_)) eq $letters; | |
} | |
sub sort_letters { | |
my $letters = shift; | |
return join '', sort split //, $letters; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment