Title: RE: Trouble with sysread in modperl

Stas,

        Does this mean read or sysread not work properly in mod_perl and we should stay away from the two functions if we write perl code to work with Apache server?

Regards,
Hui
-----Original Message-----
From: Stas Bekman [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 08, 2003 7:09 AM
To: Liu, Hui (GXS)
Cc: [EMAIL PROTECTED]
Subject: Re: Trouble with sysread in modperl


Liu, Hui (GXS) wrote:
> Stas,
>
>         Yes we tried reading <STDIN> and it works:
>
>     while ($readData = <STDIN>) {
>         $buffer        .= $readData;
>         $bufferLength   = length($buffer);
>         ......
>     }
>
>         But it's not working with sysread or read, here are the results
> for read, the last line is what we expected but it's null:
>
>    while ($bytesRead = read(STDIN, $buffer, 4096)) {
>         &html("bytesRead=[$bytesRead] data="" if ($debug);
>     }
>
> Here's the results from the above code :

I suggest that you look at the implementation of the function read_multipart()
in CGI.pm, which does exactly what you want. (I see no reason why not using
CGI.pm in first place if you can.)

And please, refrain from posting emails with huge chunks of useless
information, in the future. Truncate to keep only the information that may
help to understand and reproduce the problem.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to