Re: Initializing CGI Object from $r
Wade Burgett ([EMAIL PROTECTED]) said something to this effect on 04/21/2001: > sub handler { > my $r = shift; > my $CGIQuery = new CGI($r); > }; I think this will do what you are thining: sub handler { my $r = shift; my $CGIQuery = CGI->new($r->method qe 'POST' ? $r->content : $r->args); And so on. This will initalize the CGI object with either the content from STDIN or the query string. But, why wouldn't you jsut use the native Apache API? (darren) -- "... if the source isn't available, it isn't a scientific result... scientific experiments works on reproducibility, and reproducibility in computer science experiments includes peer review of the source code to ensure that your results are due to what you said they were." -- Andrew Bromage (http://www.advogato.org/person/Pseudonym/)
Re: Initializing CGI Object from $r
Hi, CGI accepts filehandles, hashref's, manually typed query string and another CGI object. (type 'perldoc CGI'). You don't want to pass it any of these because they're mainly used for debugging. Just create an instance of CGI without passing it any params. Since you're writing a handler I assume you're just using CGI for it's HTML routines and not to retreive POST or GET data. You want to use the Apache modperl modules as far as possible for getting input data and outputting headers, HTML etc. Wade Burgett wrote: > Can I initilize a new CGI object just by passing in a request from a > handler? > ie > > sub handler { > > my $r = shift; > my $CGIQuery = new CGI($r); > > }; -- Mark Maunder [EMAIL PROTECTED] http://swiftcamel.com/ Try not. Do. Or do not. There is no try. ~yoda