in reply to script optimization

Use one of Regexp::Assemble/Regexp::Trie/Regex::PreSuf to assemble an efficient regex then make a single substitution pass

my %Replacement = { q/"-/ => q/"Ä/, ... ); ... while ... s/($rere)/$Replacement{$1}/g; ...