my %dict = do { open my $fh, '<', '/usr/dict/words' or die $!; map {chomp; join( '', sort split //, lc $_), $_} <$fh>; }; my $canon = join '', sort split //, lc 'RTESAMCNA'; print $dict{$canon} if exists $dict{$canon};