You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Geoffrey Young <gy...@laserlink.net> on 2001/06/08 21:25:02 UTC

RE: Resetting STDIN after r->read


> -----Original Message-----
> From: rodney Broom [mailto:rbroom@Desert.NET]
> Sent: Friday, June 08, 2001 3:25 PM
> To: modperl@apache.org
> Subject: Resetting STDIN after r->read
> 
> 
> 
> I've got this module that needs to redirect sometimes. In 
> doing this, the
> next request misses any POST data. I was playing with saving 
> the data to
> disk and then reloading it on the next request like this:
> 
>   if ($first_pass) {
>     $r->read($data, ...);
>     print TEMP_FILE, $data;
>     return REDIRECT;
>   }
>   else {
>     open(STDIN, "<$temp_file");
>     $r->subprocess_env(CONTENT_LENGTH => -s $temp_file);
>   }
> 
> The idea here is that normal packages like CGI won't have to 
> know what's up
> and my programmers won't have to work around this. But, when 
> I get to the
> script, STDIN is empty. Ay thouhts about how to handle this?

of course
http://perl.apache.org/guide/snippets.html#Redirecting_POST_Requests

--Geoff
 

Re: Resetting STDIN after r->read

Posted by rodney Broom <rb...@Desert.NET>.
From: Geoffrey Young <gy...@laserlink.net>
> of course
> http://perl.apache.org/guide/snippets.html#Redirecting_POST_Requests


Heh, close. I'm using an external redirect because my purpose is to reset
the address in the client's "Location" bar. So an internal redirect won't
give me the desired effect.

---
Rodney Broom
Programmer: Desert.Net