I find it a bit strange too. Althought forementioned, I was really suprised that when I saved the output from FireFox to a file, that file contains nothing except the newline. Flock browser gave me the same result. However, I managed to save correctly with links (I didn't try it with old good lynx, I don't have it).

At first I thought it had something to do with the system function so I try to reproduce it with a simple script (system.cgi):

#!/usr/bin/perl print "Content-type: text/plain\n\n"; system 'uptime';
but it ran well on FireFox, it displayed the text on the browser, I could save it to a file, and the content is:
$ cat /tmp/uptime-system.cgi 09:08:55 up 1:10, 4 users, load average: 1.23, 0.80, 0.48
However, I'm a bit curious to see the appearantly overlapping code below the while {} block in convert_word2.cg. You may try to remove that code that reopen the $out file and let fiction_word_to_txt prints its output directly to the browser so you don't have to redirect it to a temporary file, like:
system("/home/bcrowell/Documents/programming/scripts/fiction_word_to_t +xt <$in") and die "error executing fiction_word_to_txt: $!\n";
Another possible option is to convert the doc file on the fly without external program so it works with filehandle. In other words, streaming the file. Is fiction_word_to_txt a Perl program? See also if OLE::Storage can help you.

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!


In reply to Re: CGI outputs plain text -- can't "Save Page As?" by naikonta
in thread CGI outputs plain text -- can't "Save Page As?" by bcrowell2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.