You really ought to use
<br> tags...
If the browser closes or not is the browser's problem. Normally I would guess it closes, unless some prefetching to offline copies is made.
I would guess the following code should tell you wether you're still interested in the socket:
my $rout = '';
vec ($rout,fileno(SOCKET),1) = 1;
while (select(undef,$rout,undef,0.5)){
syswrite SOCKET, $lines;
}
close SOCKET;
The four arg
select function tests for readiness on a number of file descriptors. You have to construct vectors with the bits set at the indices which are the file desc numbers you want to test. The first vector will test for read, the second for write, and the third for err (on 3 way pipes). The fourth argument is the timeout, and can be a float.
I'm not sure this will work on the browser side, as every browser will behave differently with an unfinished source.
-nuffin
zz zZ Z Z #!perl