perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dodger" <>
Subject Autoflush without NPH...
Date Fri, 16 Apr 2004 17:37:37 GMT
Hi, all.

Okay here's one I'm curious about... don't need it immediately, I think, but
it would be nice to undesatand ahead of time.

According to the mod_perl documentation, it says:


To run a Non Parsed Header CGI script under mod_perl, simply add to your

  local $| = 1;

And if you normally set PerlSendHeader On, add this to your server's
configuration file:

  <Files */nph-*>
    PerlSendHeader Off


Now, as long as PerlSendHeader is*On* will that make sure that it does NOT
run as an NPH script if $! is set to 1?

The reason is that I have been known to set $| to 1 when I've got a
*regular* script doing thngs that might go slowly (such as, for instance but
not vital at the moment, on a 'Join' page printing out some reassurance to
the user that things are being processed while connecting to the SMTP server
to send the validation mail, which can be slow).

I've even had some comments that it looks really neat when I do this, since
a newline doesn't mean a newline in HTML so I can do things like:

Doing something that's slow: Done
Doing something even slower: . . . Done

(Even if the HTML source output ends up ugly)
(The 'Done' parts and the dots appear after things are done or stages of the
things are done, and show up on the browser as they are complete, as the
page simply hasn't finished loading, but it looks all dynamically
interactive when it's  really not, plus there's no 'wait time' where the
user might be hitting refresh and stupid things like that).

However, if the PerlSendHeader On doesn't stop it completely from being an
NPH script, then doing this would theoretically cause problems, I'd think.

Any elucidation out there?


Report problems:
Mail list info:
List etiquette:

View raw message