=encoding euc-jp =head1 NAME =begin original URI::QueryParam - Additional query methods for URIs =end original URI::QueryParam - URI のための追加のクエリメソッド =head1 SYNOPSIS use URI; use URI::QueryParam; $u = URI->new("", "http"); $u->query_param(foo => 1, 2, 3); print $u->query; # prints foo=1&foo=2&foo=3 for my $key ($u->query_param) { print "$key: ", join(", ", $u->query_param($key)), "\n"; } =head1 DESCRIPTION =begin original Loading the C module adds some extra methods to URIs that support query methods. These methods provide an alternative interface to the $u->query_form data. =end original Loading the C module adds some extra methods to URIs that support query methods. These methods provide an alternative interface to the $u->query_form data. (TBT) =begin original The query_param_* methods have deliberately been made identical to the interface of the corresponding C methods. =end original The query_param_* methods have deliberately been made identical to the interface of the corresponding C methods. (TBT) =begin original The following additional methods are made available: =end original The following additional methods are made available: (TBT) =over =item @keys = $u->query_param =item @values = $u->query_param( $key ) =item $first_value = $u->query_param( $key ) =item $u->query_param( $key, $value,... ) =begin original If $u->query_param 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. =end original If $u->query_param 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. (TBT) =begin original 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. =end original 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. (TBT) =begin original 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. =end original 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. (TBT) =item $u->query_param_append($key, $value,...) =begin original 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: =end original 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: (TBT) $u->query_param($key, $u->query_param($key), $value,...); =begin original One difference is that this expression would return the old values of $key, whereas the query_param_append() method does not. =end original One difference is that this expression would return the old values of $key, whereas the query_param_append() method does not. (TBT) =item @values = $u->query_param_delete($key) =item $first_value = $u->query_param_delete($key) =begin original Deletes all key/value pairs with the given key. The old values are returned. In a scalar context, only the first value is returned. =end original Deletes all key/value pairs with the given key. The old values are returned. In a scalar context, only the first value is returned. (TBT) =begin original Using the query_param_delete() method is slightly more efficient than the equivalent: =end original Using the query_param_delete() method is slightly more efficient than the equivalent: (TBT) $u->query_param($key, []); =item $hashref = $u->query_form_hash =item $u->query_form_hash( \%new_form ) =begin original 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. =end original 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. (TBT) =begin original Note that sequence information is lost. This means that: =end original Note that sequence information is lost. This means that: (TBT) $u->query_form_hash($u->query_form_hash) =begin original is not necessarily a no-op, as it may reorder the key/value pairs. The values returned by the query_param() method should stay the same though. =end original is not necessarily a no-op, as it may reorder the key/value pairs. The values returned by the query_param() method should stay the same though. (TBT) =back =head1 SEE ALSO L, L =head1 COPYRIGHT Copyright 2002 Gisle Aas. =begin meta Translate: SHIRAKATA Kentaro (1.35) Status: in progress =end meta =cut