> Probably your web server is timing out the request and killing your
> script. Web servers don't like to run long-running processes like
> this. Perhaps you can fork off a child and have the child take care
> of it.

Another solution is to have something like the following in your loop:
--------------------------------------------------
local $|=1; # print things right away (no buffering)
# $ltime and $ctime should be defined before the loop
$ctime = time();
if ($ltime ne $ctime){
    print " . ";
    $ltime = $ctime;
}
--------------------------------------------------
Then the browser does not time out because it continually gets information, so it 
simply prints
another period to the browser every one second that it is working.  This can help you 
know its still
working.

Regards,
David



----- Original Message -----
From: "Bob Showalter" <[EMAIL PROTECTED]>
To: "'Octavian Rasnita'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, July 15, 2002 9:28 AM
Subject: RE: Why "Premature end of script headers"?


> -----Original Message-----
> From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 8:18 AM
> To: [EMAIL PROTECTED]
> Subject: Why "Premature end of script headers"?
>
>
> Hi all,
>
> I've made a little script that takes the lines from a file,
> removes the
> dupplicate lines and prints the result to a new file.
> I've read the original file line by line because it is a big
> file (over 7
> MB).
> The problem is that after printing almost 10% from the
> original file into
> the new file, the script dies and the only error I get in the
> log file is:
>
> [Mon Jul 15 14:44:48 2002] [error] [client 127.0.0.1] Premature end of
> script headers: clean.pl
>
> I've checked the original file to see if there are  some
> strange characters
> in that line, or in the next one, but I haven't found
> something that might
> cause  that problem.
>
> Please tell me why is the script dying only after it runs for
> a few minutes,
> and after writing  over 11000 lines, and not from the
> beginning, if there is
> a problem with the script.
>
> Can you find any problems with my scriptt?

Probably your web server is timing out the request and killing your
script. Web servers don't like to run long-running processes like
this. Perhaps you can fork off a child and have the child take care
of it.

See http://www.stonehenge.com/merlyn/WebTechniques/col20.html for a
nice technique on this.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to