httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Httpd Wiki] Trivial Update of "FAQ" by SpiceMan
Date Fri, 10 Dec 2010 16:19:02 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The "FAQ" page has been changed by SpiceMan.
The comment on this change is: early 90s perl 4 code fixed to perl 5.
http://wiki.apache.org/httpd/FAQ?action=diff&rev1=26&rev2=27

--------------------------------------------------

  
  {{{#!perl
  {
+  my $current_file_handle = select (STDOUT);
+  local $| = 1;
-  local ($oldbar) = $|;
-  $cfh = select (STDOUT);
-  $| = 1;
   #
   # print your HTTP headers here
   #
+  select ($current_file_handle);
-  $| = $oldbar;
-  select ($cfh);
  }
  }}}
+ 
  This is generally only necessary when you are calling external programs from your script
that send output to stdout, or if there will be a long delay between the time the headers
are sent and the actual content starts being emitted. To maximize performance, you should
turn buffer-flushing back off (with $| = 0 or the equivalent) after the statements that send
the headers, as displayed above.
  
  If your script isn't written in Perl, do the equivalent thing for whatever language you
are using (e.g., for C, call fflush() after writing the headers).

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message