IOrdy has asked for the wisdom of the Perl Monks concerning the following question:
I wrote this module and I also wrote one for Apache:Request but for some reason it's returning params us 'undef'. If someone could take a look and tell me if I have done anything wrong.
#!/usr/bin/perl -w package iXML::Buffer::CGI; use strict; # use CGI ':standard'; use CGI; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = { 'r' => new CGI, 'html' => undef, 'redir' => undef, }; bless($self, $class); return $self; } sub html { my ($self, $html) = @_; $self->{html} = $html; } sub redir { my ($self, $redir) = @_; $self->{redir} = $redir; } sub output { my $self = shift; if ($self->{redir}) { $self->{r}->status(302); # $self->{apr}->header_out('Location', $ENV{SCRIPT_NAME}.$self +->{redir}); $self->{r}->header_out('Location', $self->{redir}); $self->{r}->header('text/html'); $self->{r}->print($self->{html}); }else{ $self->{r}->header('text/html'); $self->{r}->print($self->{html}); } } sub param { my ($self) = shift; my @in_params = $self->{r}->param; my %out_params; foreach my $p (@in_params){ %out_params = ( $p => $self->{r}->param($p), ); } return \%out_params; } 1;
Back to
Seekers of Perl Wisdom