Manual Pages for UNIX Darwin command on man URI::QueryParam
MyWebUniversity

Manual Pages for UNIX Darwin command on man URI::QueryParam

URI::QueryParam(3) User Contributed Perl Documentation URI::QueryParam(3)

NAME

URI::QueryParam - Additional query methods for URIs

SYNOPSIS

use URI;

use URI::QueryParam;

$u = URI->new("", "http");

$u->queryparam(foo => 1, 2, 3);

print $u->query; # prints foo=1&foo=2&foo=3

for my $key ($u->queryparam) {

print "$key: ", join(", ", $u->queryparam($key)), "\n";

}

DESCRIPTION

Loading the "URI::QueryParam" module adds some extra methods to URIs

that support query methods. These methods provide an alternative

interface to the $u->queryform data.

The queryparam* methods have deliberately been made identical to the interface of the corresponding "CGI.pm" methods. The following additional methods are made available:

@keys = $u->queryparam

@values = $u->queryparam( $key )

$firstvalue = $u->queryparam( $key )

$u->queryparam( $key, $value,... )

If $u->queryparam is called with no arguments, it returns all the

distinct parameter keys of the URI. In a scalar context it returns the number of distinct keys.

When a $key argument is given, the method returns the parameter

values with the given key. In a scalar context, only the first parameter value is returned. If additional arguments are given, they are used to update successive parameters with the given key. If any of the values provided are array references, then the array is dereferenced to get the actual values.

$u->queryparamappend($key, $value,...)

Adds new parameters with the given key without touching any old parameters with the same key. It can be explained as a more efficient version of:

$u->queryparam($key,

$u->queryparam($key),

$value,...);

One difference is that this expression would return the old values

of $key, whereas the queryparamappend() method does not.

@values = $u->queryparamdelete($key)

$firstvalue = $u->queryparamdelete($key)

Deletes all key/value pairs with the given key. The old values are returned. In a scalar context, only the first value is returned. Using the queryparamdelete() method is slightly more efficient than the equivalent:

$u->queryparam($key, []);

$hashref = $u->queryformhash

$u->queryformhash( \%newform )

Returns a reference to a hash that represents the query form's key/value pairs. If a key occurs multiple times, then the hash value becomes an array reference. Note that sequence information is lost. This means that:

$u->queryformhash($u->queryformhash)

is not necessarily a no-op, as it may reorder the key/value pairs.

The values returned by the queryparam() method should stay the same though.

SEE ALSO

URI, CGI COPYRIGHT Copyright 2002 Gisle Aas.

perl v5.8.8 2004-01-14 URI::QueryParam(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™