in reply to write to a fax machine?

If you're on Unix, you can run Hylafax as a fax server. It can fax ASCII text; all you have to do is print out the order from your perl script and let the sendfax client interface with Hylafax to do the actual faxing.