Thanks for providing all this, that gives us a lot more to work on. I am intrigued by some of your s/// operations - perhaps you could confirm that these give your intended outputs?
$ echo Washington werewolves are wasteful | perl -pe 's/w(as|ere)/be/g
+i;'
behington bewolves are beteful
$ echo No work was carried out on Thursday as that as a day of rest |
+perl -pe 's/\s.*work.*/ work /gi;'
No work
$ echo Did you swallow all that bacon | perl -pe 's/\s.*allow.*/ allow
+ /gi;'
Did allow
$
As there's no point optimising code which doesn't do what you want it would be good to clear this sort of thing up first.