The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTTP::Query - Class designed to allow easy manipulation of query strings

SYNOPSIS

    require HTTP::Query;
    
    my $q = HTTP::Query.new();
    
    $q.parse_params('foo=bar&baz=quux');
    
    my $params = $q.params();
        # or `$q.param()` (for backward compatibility)
    
    my $foo = $q.param('foo');
    
    $q.param('foo') = <an array of values>;
        # or `$q.param('foo', 'an', 'array', 'of', 'values');`
    
    $q.delete('foo');
    
    $q.clear();

DESCRIPTION

An object of this class represents the query string portion of a requested URI. It provides the following methods:

$q.parse_params($data)

Parses the given string, seperating it into 'name' and 'value' pairs. This method should be called before any other methods, as it initialises the list of parameters.

$q.params()

Returns the names of all the parameters as a list. The order in which they were present in the query string is preserved.

$q.param()

This exists as an alias for params.

$q.param($name)

Returns the value of the parameter named $name. If called in List context, it will return a list of values. Otherwise, it will return the first value.

$q.param($name, $val1, $val2...) or $q.param($name) = @vals

Assigns @vals to the parameter named $name.

$q.delete($name)

Deletes the parameter named $name.

$q.clear()

Deletes all the parameters.

AUTHORS

"Aankhen"

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html