Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Clever autoflush detail

by talexb (Chancellor)
on Jun 20, 2007 at 18:51 UTC ( [id://622358]=note: print w/replies, xml ) Need Help??


in reply to Re: Clever autoflush detail
in thread Autoflush and web browsers (was: Clever autoflush detail)

    Normally, html ignores CR/LF. So, the browser cannot display the line until it gets something (like: BR or P) that tells it that this 'line' is complete and can be formatted.

Right, but I made a point of setting the content type to be text/plain (that is, specifically not to be HTML), and that worked correctly using the shell script, but not using the Perl script. That's why I'm confused.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re^3: Clever autoflush detail
by Joost (Canon) on Jun 20, 2007 at 19:28 UTC

      The first Perl script in my original post had 'text/plain'; that's the one that I'm talking about.

      And as blahblah correctly points out lower down, this appears to have something to do with CGI, because if I remove that dependency as follows:

      #!/usr/bin/perl -w $|=1; { print "Content-type: text/plain\n\n"; print "Autoflush is currently " . ($|?"on":"off") . ".\n"; for ( 1..5 ) { print "Value is $_.\n"; sleep 1; } print "Autoflush is currently " . ($|?"on":"off") . ".\n"; }

      The script works properly. So CGI is ignoring $| and doing its own caching. Now I know.

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://622358]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-29 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found