Works fine for me, until I add the browser to the equation.
The program I used:
#!/usr/bin/perl $| = 1; print <<'END_HTML'; Content-type: text/html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <title>PAGE TITLE</title> </head> <body> <p>Start. END_HTML sleep(5); print <<'END_HTML'; <p>done. </BODY> </HTML> END_HTML
Running it from the prompt:
$ foo.cgi Content-type: text/html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <title>PAGE TITLE</title> </head> <body> <p>Start. ...waits 5 secs... <p>done. </BODY> </HTML>
Running it from via the web server:
$ telnet www.example.com 80 Trying 11.22.33.44... Connected to www.example.com. Escape character is '^]'. GET /script.cgi HTTP/1.0 Host: www.example.com HTTP/1.1 200 OK Date: Mon, 17 Dec 2007 22:39:09 GMT Server: Apache/2.0.54 (Unix) PHP/4.4.7 mod_ssl/2.0.54 OpenSSL/0.9.7e m +od_fastcgi/2.4.2 DAV/2 SVN/1.4.2 Vary: Accept-Encoding Connection: close Content-Type: text/html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <title>PAGE TITLE</title> </head> <body> <p>Start. ...waits 5 secs... <p>done. </BODY> </HTML> Connection closed by foreign host.
But when viewed in FireFox 2, it waits for the entire document to arrive before display it.
In reply to Re: I think I'm misunderstanding $|
by ikegami
in thread I think I'm misunderstanding $|
by sigmazero13
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |