Ahh that is an additional stipulation you did not initally make.
Two of the options I gave meet this new criterion, also see
the update I have added. However, IMO this is much
like somebody coming here asking to implement
some given functionality and saying "no modules".
There is a very good reason this software(or modules) exist,
and that is to meet a need and make the solution available for
others, no reinventing the wheel.
--
perl -pe "s/\b;([st])/'\1/mg"