in reply to Re: Re: Repeated lines
in thread Repeated lines

I'm a little confused... In your original post, you said that, when run as a CGI, the program output everything twice. But in the sample output you posted in your second node, you show Content-type: text/plain beginning output twice, but the list of mispelled words output only once.

If the latter is the case, then I suspect that Lingua::Ispell is forking off a subprocess to handle the spell-checking, before the output buffers have been flushed, and so everything that was printed before the fork gets output twice.

The solution is to turn on autflushing, by setting $| = 1 at the top of your program, before you print anything.

(I believe that the latest version of Perl avoids this problem by automatically flushing output buffers when it's about to fork.)