[Pdx-pm] Apache, mod_perl, Catalyst, qx, and the ampersand

Roderick A. Anderson raanders at acm.org
Mon Jan 8 19:32:03 PST 2007


Thanks Kris but I've been there, done that, got a t-shirt.

The problem, I believe, is with POE::Component::Server::HTTP 's $request 
object.  I had just got started in the code when I got interrupted with 
another burning-duck so I could find out what it was really doing.  Well 
I also couldn't figure out how to turn what it was returning into an 
INPUTFILE or handle.

I'll probably end up in the guts of CGI.pm also.


Rod
-- 
Kris Bosland wrote:
> You should see if you can get the POST info out of the relevant filehandle
> with CGI.pm like this:
> 
> ==============================================================
> CREATING A NEW QUERY OBJECT FROM AN INPUT FILE
> 
>      $query = new CGI(INPUTFILE);
> 
> If you provide a file handle to the new() method, it will read parameters
> from the file (or STDIN, or whatever). The file can be in any of the forms
> describing below under debugging (i.e. a series of newline delimited
> TAG=VALUE pairs will work). Conveniently, this type of file is created by
> the save() method (see below). Multiple records can be saved and restored.
> 
> Perl purists will be pleased to know that this syntax accepts references
> to file handles, or even references to filehandle globs, which is the
> ``official'' way to pass a filehandle:
> 
>     $query = new CGI(\*STDIN);
> 
> You can also initialize the CGI object with a FileHandle or IO::File
> object.
> ==============================================================
> 
> -Kris
> 
> 
> On Mon, 8 Jan 2007, Roderick A. Anderson wrote:
> 
>> Roderick A. Anderson wrote:
>>> I'm starting here to get some ideas on whether I'm going anywhere near
>>> the right direction.
>>>
>>> We have a Catalyst based application but have been asked to some
>>> non-View processing while the user continues with other things.
>>>
>>> Short-ish story is we pull a XML file -- specified as a GET from a URL
>>> redirect.  Parse it and get a URI/URL of a large file.  The next step is
>>> to pull that file back but not make the user wait on it.  They should be
>>> able to continue with other parts of the process.
>>>
>>> I'm wondering if
>>>
>>> 	qx{ script_that_does_the_get_and_other_magic & };
>>>
>>> is the right way to go.  Other methods of backgrounding a process from
>>> within Apache/mod_perl.
>>>
>>> This clear as mud?
>> I thought I had picked an option based on the post by Nate Nuss but
>> going through the Catalyst thread.  I'm thinking a POE server will be
>> the best long term as well as providing a similar functionality for some
>> other processes.
>>
>> Trouble is the example code from the POE site ( http://pow.perl.org )
>> doesn't work for a POST.
>>
>> 	http://poe.perl.org/?POE_Cookbook/CGI_Requests
>>
>> Is what I want to use and it uses what I'm used to -- CGI.pm
>>
>> The problem is I can't get it to use a POST.  I looks like the $request
>> object doesn't return anything "new CGI()" can use.  Since everything I
>> seen for far uses POST to send the key=value pairs I'm kind if in a
>> tough spot.  There is a RT ticket but it is from May 2005.
>>
>> Any suggestions for how to resolve the POE::Component::Server::HTTP
>> issue with POSTs?
>>
>>
>> I'm going to dive into the code for awhile but I hoping someone might
>> have resolved this already.
>>
>>
>> Rod
>> --
>>
>>>
>>> Rod
>> _______________________________________________
>> Pdx-pm-list mailing list
>> Pdx-pm-list at pm.org
>> http://mail.pm.org/mailman/listinfo/pdx-pm-list
>>
>>
>> !DSPAM:45a2cbe6239682701912406!
>>
>>
> 



More information about the Pdx-pm-list mailing list