in reply to Safe way to open files

Depending on your definition of safe you should be using 3-arg open instead of 2-arg. You could also make your sub take parameters like 3-arg, and save yourself the string bashing ;-)

--
perl -pew "s/\b;([mnst])/'$1/g"