in reply to Still having problems with spanish characters

Try

... if (exists $arrayin[0] && $arrayin[0] eq "Spanish_LatinAmerica +n|es_MX") { $spanishword = trim( $arrayin[1] ); }

i.e. the hash key must be trimmed the same way the lookup string is, otherwise they won't match...

To debug such issues yourself, simply dump the entire hash using Data::Dumper:

use Data::Dumper; print Dumper \%langhash;

You would've seen that there's a leading space before " Espere ..."