diff --git a/lib/DDG/Goodie/FindAnagrams.pm b/lib/DDG/Goodie/FindAnagrams.pm index 081de8270..94b9c58d9 100644 --- a/lib/DDG/Goodie/FindAnagrams.pm +++ b/lib/DDG/Goodie/FindAnagrams.pm @@ -8,18 +8,20 @@ zci is_cached => 1; triggers start => "find anagrams"; + +my $json = scalar share('words.json')->slurp; + +my %wordHash = %{decode_json($json)}; + +#print Dumper(\%wordHash); + + handle remainder => sub { if ($_ eq ""){ return "No Anagrams Found." } - my $json = scalar share('words.json')->slurp; - - my %wordHash = %{decode_json($json)}; - - #print Dumper(\%wordHash); - # Format string to look like hash key by making it lowercase then splitting the string into chars, sort them and finally join back into sorted string my $sorted_string = join("",sort(split(//,lc($_))));