in reply to CGI Buffer module will not return params.

I'm not sure i understand your param() method - what is it's purpose? Wouldn't it be easier and more effective to just use something like:
sub param { my ($self,$param) = @_; return $self->{'r'}->param($param); }
With your code, what happens if i send a query string like foo.cgi?foo=bar&foo=baz&foo=qux?

Style issues:
Remember that => automagically quotes the left hand side:

my $self = { r => CGI->new(), html => undef, redir => undef, };
Also note that i used the direct notation to instantiate the CGI object, this is not at all necessary, but it is a good habit to get into.

In output(), since you are refering to $self->{r} multiple times, i recommend assigning it to a scalar:

sub output { my $self = shift; if ($self->{'redir'}) { my $r = $self->{'r'}; $r->status(302); # etc ... } }

Other than that it looks good - try mortis's suggestion, then test it with a query string that contains multilples values for one variable. Make sure you get an array back, otherwise you might want to just write a wrapper for the param method like i did. But, again, what is the purpose of this module, why would i want to use it instead of CGI.pm?

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
F--F--F--F--F--F--F--F--
(the triplet paradiddle)

Replies are listed 'Best First'.
Re: (jeffa) Re: CGI Buffer module will not return params.
by IOrdy (Friar) on Nov 22, 2001 at 03:18 UTC
    I wrote a site that used Apache::Request then yesterday I needed to swap it to CGI because it needs to run in a win32 environment under indigostars microweb (which only has CGI.pm).

    To save time having to swap various things (because if I do $apache_request->param it returns a hash reference) I thought it would be simpler to write them both into modules with the same interface so I can pick and choose.