kleinbiker7 has asked for the wisdom of the Perl Monks concerning the following question:

I need to be able to do the following:

Create a Perl script that creates a Microsoft Word (RTF) file for a user to download. In other words, create a simple script that outputs a file that is in MS Word format. So, when I pull up the URL of the script using Netscape, I would be prompted to either download or open the document.

Now I dont know what to do here, so any help is gratefully accepted!

Cheers!

Replies are listed 'Best First'.
Re: Creating MS Word files
by LD2 (Curate) on Aug 13, 2001 at 21:59 UTC
Re: Creating MS Word files
by trantor (Chaplain) on Aug 13, 2001 at 21:41 UTC

    A casual search on CPAN revealed all the modules you need to generate RTF, and possibly more...

    -- TMTOWTDI

Re: Creating MS Word files
by marvi (Sexton) on Aug 14, 2001 at 12:23 UTC
    If your web host is running Activestate Perl and have Microsoft Word installed, you could create the file using OLE. See Win32::OLE
    We used that technique to create Excel files. Now we might have used Spreadsheet::WriteExcel instead.

    It's sure nice to have a perl-only solution, but if you already have heavily loaded Word documents and templates, it might be easier to use OLE just to fill in a few things, rather than creating a RTF from scratch.
Re: Creating MS Word files
by John M. Dlugosz (Monsignor) on Aug 13, 2001 at 23:34 UTC
    When I did it, maybe 6 years ago, I found an RTF reference in the MSDN, and then exported sample files from Word to fill in the gaps in the documentation.