#!/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;