in reply to What if last line has no LF?
in thread Look ahead and join if the line begins with a +

Simple, you don't do that ;-). Seriously, you have a valid point but I don't think it's unreasonable to know your data. It's also not unreasonable to code in a seemingly data independent manner either, but it may just be a throw away tool.

You could also test to $_ upon exiting the loop, and act accordingly, probably undef'ing $_ withing the loop on each execution.

--
perl -pe "s/\b;([mnst])/'\1/mg"