NAME

HTML::StickyForm::RequestHash - Minimal CGI-like request object

SYNOPSIS

my $req=HTML::StickyForm::RequestHash->new(
  key1 => 'abc',
  key1 => 'def',
  key2 => ['ghi','jkl'],
);
my @keys=$req->param;
my $val1=$req->param('key1');
my @val2=$req->param('key2');

DESCRIPTION

This class provides the minimum features required of a request object by HTML::StickyForm, for use in cases where a normal request is not available. This might be because an empty request is needed, or where parameters are available, but it is not appropriate to use CGI or Apache::Request.

CLASS METHODS

new(PAIRLIST)

Constructor. Creates a request object with the supplied list of parameters. Multiple values for the same parameter name can be set up either by passing multiple name/value pairs, or by passing arrayrefs for values. It is not an error to mix these methods - all supplied values will be set in the new object.

METHODS

param()

Returns a list of the names of all configured parameters. Each name is listed only once, regardless of how many values are configured for any given name.

param($name)

In scalar context, returns the first configured value for the given name. In list context, returns all configured values for the given name.

AUTHOR

Copyright (C) Institute of Physics Publishing 2005

Peter Haworth <pmh@edison.ioppublishing.com>

You may use and distribute this module according to the same terms that Perl is distributed under.