First: I second kennethk's questions... (second)here are a few remarks of my own:
libreoffice will probably do the job very nicely.
If it won't, it will at least reduce the .docx to .rtf or even text, which may be a lot easier to work with
...unless the document has some substantive reason for fancy formatting -- which is to say, a reason the data would be less useful if not colorized, italicized, boldfaced, indented, outdented... blah, blah, blah.
Alternately, CPAN has many offerings which may be useful -- though I didn't take the time to check their applicabiltiy to centos. A simple google of "site: CPAN.org docx" will show you the wealth of options
If you didn't program your executable by toggling in binary, it wasn't really programming!