You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Sean T Allen <se...@usaherbals.com> on 2004/11/17 19:15:16 UTC

read not sysread?

using 1.99_17...

moved code to a new machine that i built as compared to a pre-existing 
machine running... 1.99_07-dev

i have a stripped down CGI reading routine...

        eval ( "sysread( \STDIN, \$input, $ENV{ 'CONTENT_LENGTH' } )" );

doesnt read anything

but

            read( STDIN, $input, $ENV{ 'CONTENT_LENGTH' } );

does

there is a warning in the error log for the line that the eval is on:

Unrecognized escape \S passed through at /ai/toppik/lib/Infant/CGI.pm 
line 484.

any quick help on fixing this problem is appreciated. or actually just 
an explaination...

if i had built the preeceeding server i could probably track down why it 
works there
and not here... but i didn't so... any pointers re what is the right 
direction to look
are greatly appreciated.




Re: read not sysread?

Posted by Stas Bekman <st...@stason.org>.
Sean T Allen wrote:
> using 1.99_17...
> 
> moved code to a new machine that i built as compared to a pre-existing 
> machine running... 1.99_07-dev
> 
> i have a stripped down CGI reading routine...
> 
>        eval ( "sysread( \STDIN, \$input, $ENV{ 'CONTENT_LENGTH' } )" );

CGI.pm uses read, not sysread. Where did you find sysread in it? Which 
version are you using. (and in the future please follow the guidelines on 
problems report: http://perl.apache.org/bugs/ so we don't have to ask the 
same questions again and again)

> doesnt read anything
> 
> but
> 
>            read( STDIN, $input, $ENV{ 'CONTENT_LENGTH' } );
> 
> does
> 
> there is a warning in the error log for the line that the eval is on:
> 
> Unrecognized escape \S passed through at /ai/toppik/lib/Infant/CGI.pm 
> line 484.
> 
> any quick help on fixing this problem is appreciated. or actually just 
> an explaination...

under mod_perl STDIN is tied *only* if run under 'perl-script'
http://perl.apache.org/docs/2.0/user/config/config.html#C_perl_script_
and then you can read() from it.

perl's tie interface doesn't support SYSREAD (see perltie.pod), so you 
can't use sysread under mod_perl.

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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html