in reply to Re: Malformed HTML output
in thread Malformed HTML output

I understand that it's hard to troubleshoot without showing you the code, but I doubt you'd ever want to pore through the roughly 1000 lines of really messy code to see what the problem is, so I'm trying to just give you the most relevant portions. I can post the whole printing subroutine here if you really think that would help, though.

Anyway, I'm not actually storing everything in a variable and printing it out... I'm printing it out as I go. There doesn't seem to be anything really special about why the HTML is starting to print at that point -- or at least none that I can see. Like I said before, for some reason, when I comment out a few lines that print some hidden text fields, everything prints normally. It just refuses to print all of the HTML when I use all the fields I need.

As for autoflush -- what is that, and how would I enable it? What does that do, anyway?

Thanks again for your help.

Replies are listed 'Best First'.
Re: Re: Re: Malformed HTML output
by sauoq (Abbot) on Jul 24, 2003 at 23:31 UTC
    As for autoflush -- what is that, and how would I enable it? What does that do, anyway?

    When autoflush is on, it forces a flush on the filehandle after every print. It's generally a good idea for autoflush to be on for STDOUT in CGI scripts. The easiest way to do that is to put $| = 1; near the top of your CGI script.

    Read perldoc perlvar for more information on the $| special variable. Also, perldoc IO::Handle contains some info on autoflush.

    If I were you, I'd turn it on and keep my fingers crossed. Don't be disappointed if it doesn't work though. I'm guessing it won't.

    As for muddling through thousands of lines of messy code... well, I'd rather do that than try to guess. :-)

    -sauoq
    "My two cents aren't worth a dime.";
    
      OMG. You are my saviour! Enabling autoflush did the trick!

      *whew*

      I even crossed my fingers. ;) Thanks a lot for wading through this mess. -- simX
Re(3): Malformed HTML output
by Nkuvu (Priest) on Jul 24, 2003 at 23:23 UTC

    A quick reference to the FAQ should answer the autoflush question. But basically you'd be setting $| to true 1. The FAQ just explains exactly what you're doing by setting $| to true 1 and why you might want that.

    Edit: 1. Not "true". Don't know where that came from...