There are micro-optimizations that you could implement here, but I would not chose to implement them without a substantial amount of profiling information. In general, you want to apply 100 regexes 10,000,000 times, so you've defined your grid.
- $entry{$k} looks distinctly like you have a hash where you should have an array
- s/$regex->{from}/$regex->{to}/g would seem to dereference 100*10,000,000 times when inverting the loops would mean you only have to dereference 100 times
Nothing Earth shattering, really.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.