Title: RE: Trouble with sysread in modperl

Larry,

        Thanks for the suggestion. Does this mean if we have a 20MB file, this "read" will load the entire file into the memory?

Regards,
Hui Liu

-----Original Message-----
From: Larry Leszczynski [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 04, 2003 1:03 PM
To: Liu, Hui (GXS)
Cc: [EMAIL PROTECTED]
Subject: Re: Trouble with sysread in modperl


Hello -

> There appears to be a bug with the read and sysread functions when being
> used in a loop to read STDIN.  We're using a loop to read from STDIN in 4k
> blocks, and the read or sysread appears to work great until the very last
> read to pick up the final partial block.
[snip]

Not sure about that error, but by any chance are you trying to read POSTed
data from the request?  If so, all you need to do is:

   my $content;
   $r->read($content, $r->header_in('Content-length'));

(mod_perl cookbook recipe 3.6)


Larry Leszczynski
[EMAIL PROTECTED]

Reply via email to