Other than the other optimisations already suggested you might also find speedups using Parallel::ForkManager or MCE::Loop. Any one individual chunk/group of lines taking "a bit longer" could be mitigated by being able to (more easily than from the shell) run against n of them in parallel across the entire file.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Need to speed up many regex substitutions and somehow make them a here-doc list
by Fletch
in thread Need to speed up many regex substitutions and somehow make them a here-doc list
by xnous
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |