CGI::PersistentParams - make query parameters persist between pages
# Take query from CGI.pm
my $q = CGI::PersistentParams->new(
discard => [qw[action pass user]]
);
# Explicitly set a parameter
$q->param( template => 'foo' );
$q->param( page => 1 );
print $q->link( { template => 'bar' } );
# outputs "template=bar;page=1"
print $q->link( { page => 2 } );
# outputs "template=foo;page=2"
new ARGSReturns a new query parameter handler. The following arguments can be passed to the constructor:
cgi - the CGI query.
Will be taken from CGI.pm by default.
discard - The parameters that will not be taken from
the cgi object
link ITEMS, DEFAULTSReturns a new link out of current values and the passed items. Duplicate items are not possible.
ITEMS must be a hash reference.
Any items in the result that have the same string-value as in the DEFAULTS hashref will be omitted from the resulting string.
Currently does not URI-encode values.
hidden ITEMS, DEFAULTSReturns a string containing the defaults and the passed items as hidden form elements. Duplicate items are not possible.
ITEMS must be a hash reference.
Currently does not HTML-encode values.
merged ARGSMerges the hashref passed via ARGS and returns a fresh hashref to the merged hash.
All keys mentioned in discard are removed.
paramPasses through to the param method of the cgi object.
This module may be used under the same terms as Perl itself
Max Maischein, <corion@cpan.org>
CGI.pm