in reply to improving the speed

Do you realise you are using the global hashes in your subroutine instead of the references being passed?
@array_es = split ' ', $hash_es{$string_es}; @array_en = split ' ', $hash_en{$string_en};
It is probably a bad idea to use the same name for your reference as your global hashes. The code should be:
@array_es = split ' ', $hash_es->{$string_es}; @array_en = split ' ', $hash_en->{$string_en};
I doubt it would make any difference to the performance however.

In theory ($#array_es+1) is slightly slower than (@array_es) used in scalar context, but again I doubt it would make much difference.