in reply to
changing format of the first word of every line in an HTML doc
If the objective is to wind up with a modified Word document, you might consider using Win32::OLE to manipulate the word doc directly. This will give you an idea of how you can access the Word API via Perl. You would have to do some searching around and/or read up on the Word API to figure out how to do exactly what you want. It's a bit of a learning curve but worth it if you want to do this sort of thing often.