[24633] in Perl-Users-Digest
Perl-Users Digest, Issue: 6797 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 3 12:16:03 2004
Date: Tue, 3 Aug 2004 09:15:28 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 3 Aug 2004 Volume: 10 Number: 6797
Today's topics:
Another bizzare PerlScript/WSH problem <corff@cis.fu-berlin.de>
Re: Another bizzare PerlScript/WSH problem <invalid-email@rochester.rr.com>
Re: Another bizzare PerlScript/WSH problem <corff@cis.fu-berlin.de>
Re: Another bizzare PerlScript/WSH problem <corff@cis.fu-berlin.de>
Re: Another bizzare PerlScript/WSH problem <jurgenex@hotmail.com>
Re: Another bizzare PerlScript/WSH problem <invalid-email@rochester.rr.com>
Re: Another bizzare PerlScript/WSH problem <Joe.Smith@inwap.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Jul 2004 20:52:21 GMT
From: <corff@cis.fu-berlin.de>
Subject: Another bizzare PerlScript/WSH problem
Message-Id: <2mdc45Fldt9iU1@uni-berlin.de>
Hi All,
using a seemingly harmless "sleep" in a simple PerlScript
context virtually freezes the browser:
<HTML>
<HEAD>
<TITLE>Freeze with sleep</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="PerlScript">
while (true) {
$window->document->write("."); # Progress indicator
sleep 10;
}
</SCRIPT>
</BODY>
</HTML>
Again, I am using Windows XP Professional here, IE 6.0 and AS Perl 5.8.0.
Thanks for any hints,
Oliver.
--
Dr. Oliver Corff e-mail: corff@zedat.fu-berlin.de
------------------------------
Date: Sat, 24 Jul 2004 02:02:06 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Another bizzare PerlScript/WSH problem
Message-Id: <4101C2C3.8040408@rochester.rr.com>
corff@cis.fu-berlin.de wrote:
...
> using a seemingly harmless "sleep" in a simple PerlScript
> context virtually freezes the browser:
>
> <HTML>
> <HEAD>
> <TITLE>Freeze with sleep</TITLE>
> </HEAD>
> <BODY>
> <SCRIPT LANGUAGE="PerlScript">
> while (true) {
> $window->document->write("."); # Progress indicator
> sleep 10;
> }
> </SCRIPT>
> </BODY>
> </HTML>
Well, that's about what a script like that should do. Your server is
waiting for the script to finish before closing the output. And your
browser is waiting for the server to close its output before finalizing
its display. What were you expecting this script to do?
...
> Oliver.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: 24 Jul 2004 07:53:54 GMT
From: <corff@cis.fu-berlin.de>
Subject: Re: Another bizzare PerlScript/WSH problem
Message-Id: <2meisiFlf15vU1@uni-berlin.de>
Bob Walton <invalid-email@rochester.rr.com> wrote:
: > <SCRIPT LANGUAGE="PerlScript">
: > while (true) {
: > $window->document->write("."); # Progress indicator
: > sleep 10;
: > }
: > </SCRIPT>
: Well, that's about what a script like that should do. Your server is
: waiting for the script to finish before closing the output. And your
: browser is waiting for the server to close its output before finalizing
: its display. What were you expecting this script to do?
Well, humbly speaking, I expected the script to loop and fill the browser
window with dots, slowly, but steadily. I must confess that I do not feel
perfectly enlightened with regard to the sequence of events:
browser waits for server to close output -> understood so far
but this an only take place after:
server waits for script to finish -> I fail to understand this one.
I've written a few utilities basically using this loop, reading lines from
a file, digesting them in the desired way, and sending them to the browser
from within the while loop via $window->document->write, and they always
worked. Do I have to understand that the browser STARTS building the output
page ONLY after the while loop, reading and processing data activities have
ended?
Somehow I had expected output to start while the while loop is still active.
Thank you very much for further clarification. The finer points of job
control frequently escape my mind, my strength happens to be more in dealing
with foreign language character data.
Oliver.
--
Dr. Oliver Corff e-mail: corff@zedat.fu-berlin.de
------------------------------
Date: 24 Jul 2004 08:02:37 GMT
From: <corff@cis.fu-berlin.de>
Subject: Re: Another bizzare PerlScript/WSH problem
Message-Id: <2mejctFlf15vU2@uni-berlin.de>
Bob Walton <invalid-email@rochester.rr.com> wrote:
: > <SCRIPT LANGUAGE="PerlScript">
: > while (true) {
: > $window->document->write("."); # Progress indicator
: > sleep 10;
: > }
: > </SCRIPT>
: Well, that's about what a script like that should do. Your server is
: waiting for the script to finish before closing the output. And your
: browser is waiting for the server to close its output before finalizing
: its display. What were you expecting this script to do?
Hi Bob,
In addition to your answer and my previous mail which was, I assume, a bit
naive, I think I get the point. If I replace <SCRIPT>...</SCRIPT> and every-
thing in between by one fictive token, my HTML skeleton will look like this:
<HTML>
<HEAD>
</HEAD>
<BODY>
<Something that is represented by my SCRIPT>
</BODY>
</HTML>
And as long as the "parsing" of the token contents does not finish the
browser will never continue beyond that point. Strictly speaking, this
is not a Perl or PerlScript problem -> hence it is off topic. Sorry!
I had somehow assumed that the PerlScript Perl script keeps running,
while the rest of the HTML page is being built as well. How stupid.
Thanks again,
Oliver.
--
Dr. Oliver Corff e-mail: corff@zedat.fu-berlin.de
------------------------------
Date: Sat, 24 Jul 2004 14:18:49 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Another bizzare PerlScript/WSH problem
Message-Id: <dduMc.533$PK5.154@nwrddc02.gnilink.net>
Bob Walton wrote:
> corff@cis.fu-berlin.de wrote:
>
> ...
>> using a seemingly harmless "sleep" in a simple PerlScript
>> context virtually freezes the browser:
>>
>> <HTML>
>> <HEAD>
>> <TITLE>Freeze with sleep</TITLE>
>> </HEAD>
>> <BODY>
>> <SCRIPT LANGUAGE="PerlScript">
>> while (true) {
>> $window->document->write("."); # Progress indicator
>> sleep 10;
>> }
>> </SCRIPT>
>> </BODY>
>> </HTML>
>
>
> Well, that's about what a script like that should do. Your server is
> waiting for the script to finish before closing the output. And your
> browser is waiting for the server to close its output before
> finalizing its display. What were you expecting this script to do?
Certainly not. This PerlScript is run client side and there is no server
involved..
The script is executed "onload" and with a little bit of experimentation it
becomes quite clear that no content will be displayed by the browser until
the script is finished.
Now, if this is the expected behaviour of "onload"-scripts or a bug in the
PerlScript implementation you probably will have to ask in newsgroup that
knows a good deal more about DHTML.
jue
------------------------------
Date: Sat, 24 Jul 2004 17:00:10 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Another bizzare PerlScript/WSH problem
Message-Id: <41029525.20608@rochester.rr.com>
Jürgen Exner wrote:
> Bob Walton wrote:
>
>>corff@cis.fu-berlin.de wrote:
...
>>Well, that's about what a script like that should do. Your server is
>>waiting for the script to finish before closing the output. And your
>>browser is waiting for the server to close its output before
>>finalizing its display. What were you expecting this script to do?
>
> Certainly not. This PerlScript is run client side and there is no server
> involved..
You are correct. Sorry for the misinformation. I'll try to stick to
stuff I actually know something about...
...
> jue
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Sun, 25 Jul 2004 10:20:02 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Another bizzare PerlScript/WSH problem
Message-Id: <mPLMc.183228$XM6.102198@attbi_s53>
corff@cis.fu-berlin.de wrote:
> <SCRIPT LANGUAGE="PerlScript">
> while (true) {
> $window->document->write("."); # Progress indicator
> sleep 10;
> }
> </SCRIPT>
Browser's don't display partial lines; they buffer up HTML data until
there is a line break. Try changing that to write(".<BR>").
-Joe
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 6797
***************************************