Is there a better way to reset CGI object for AJAX POSTDATA?



Currently I'm doing this:

use CGI();
my $cgi = new CGI;
$cgi = new CGI($cgi->param('POSTDATA'));

.... in order to get the data an XMLHTTPRequest object sends through on
a POST request, because everything goes under the POSTDATA param as a
query string. AND can I just say... Yuck!

Anyway, my solution seems kludgy and I don't like it. It smells funny.

CGI.pm docs mention a class method restore_parameters() that works
like so:
open (IN,"test.in") || die;
restore_parameters(IN);
close IN;
....but there's no other mention of it, and no mention of an object
method. I can't stand using the functional interface for CGI.pm.

Isn't there any way to just reset an existing CGI object directly
without calling the constructor all over again?

--
Sean 'Dodger' Cannon
.



Relevant Pages

  • cgi.fieldstorage not getting POST data
    ... I've got a small web application (just a web interface to a MS-access ... I'll add that the scripts were working fine with the POST request ... ActiveState and Python.org didn't yield any clues that the cgi module ...
    (comp.lang.python)
  • Re: javascript to read from another URL and display output?
    ... The output from this CGI is not plain HTML but rather ... Unfortunately XMLHttpRequest implements same-domain security, ... If the data that is returned from the XMLHTTPRequest Object is in JSON then you can get around the Cross-Domain security issue. ...
    (comp.lang.javascript)
  • Re: Using HTTP::Daemon with CGI.pm
    ... Robert James Kaes wrote: ... > CGI.pm so that CGI will read a POST request? ... The cosmos, at best, is like a rubbish heap scattered at random. ...
    (comp.lang.perl.modules)
  • Re: Using HTTP::Daemon with CGI.pm
    ... > CGI.pm so that CGI will read a POST request? ... POST method. ... * Putting the Service Back in Internet Service Provider * ...
    (comp.lang.perl.modules)