in reply to I think I'm misunderstanding $|
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I think I'm misunderstanding $|
by sigmazero13 (Novice) on Dec 17, 2007 at 22:57 UTC | |
by ikegami (Patriarch) on Dec 17, 2007 at 23:11 UTC | |
by sigmazero13 (Novice) on Dec 17, 2007 at 23:20 UTC | |
by ikegami (Patriarch) on Dec 17, 2007 at 23:45 UTC | |
by ysth (Canon) on Dec 18, 2007 at 01:39 UTC | |
|
Re^2: I think I'm misunderstanding $|
by shmem (Chancellor) on Dec 18, 2007 at 10:41 UTC | |
|
Re^2: I think I'm misunderstanding $|
by quester (Vicar) on Dec 18, 2007 at 08:14 UTC |