For creating MS Word documents on a Windows machine, look into the
Win32::OLE module. There are plenty of code examples, in the documentation (mostly Excel but can easily be converted), on this site (try a
Super Search), or via the all knowing
google.