in reply to Word Document and Perl

FWIW, Microsoft Word reads HTML (including tables and fonts).

A hack I've used to make it look completely transparent is to save a document with no text but with all the potential styles as HTML from Word, then use it as a template for stuff to edit (/generate from script). This way you don't even suffer from import artefacts: if you mimic the HTML Word uses, your documents will look exactly like they would if you'd created them there.