URI-1.35 >
1.54
との差分
URI::QueryParam 1.54 と 1.35 の差分
1 | 1 | |
2 | 2 | =encoding euc-jp |
3 | 3 | |
4 | 4 | =head1 NAME |
5 | 5 | |
6 | 6 | =begin original |
7 | 7 | |
8 | 8 | URI::QueryParam - Additional query methods for URIs |
9 | 9 | |
10 | 10 | =end original |
11 | 11 | |
12 | 12 | URI::QueryParam - URI のための追加のクエリメソッド |
13 | 13 | |
14 | 14 | =head1 SYNOPSIS |
15 | 15 | |
16 | 16 | use URI; |
17 | 17 | use URI::QueryParam; |
18 | 18 | |
19 | 19 | $u = URI->new("", "http"); |
20 | 20 | $u->query_param(foo => 1, 2, 3); |
21 | 21 | print $u->query; # prints foo=1&foo=2&foo=3 |
22 | 22 | |
23 | 23 | for my $key ($u->query_param) { |
24 | 24 | print "$key: ", join(", ", $u->query_param($key)), "\n"; |
25 | 25 | } |
26 | 26 | |
27 | 27 | =head1 DESCRIPTION |
28 | 28 | |
29 | 29 | =begin original |
30 | 30 | |
31 | 31 | Loading the C<URI::QueryParam> module adds some extra methods to |
32 | 32 | URIs that support query methods. These methods provide an alternative |
33 | 33 | interface to the $u->query_form data. |
34 | 34 | |
35 | 35 | =end original |
36 | 36 | |
37 | C<URI::QueryParam> | |
37 | Loading the C<URI::QueryParam> module adds some extra methods to | |
38 | query | |
38 | URIs that support query methods. These methods provide an alternative | |
39 | ||
39 | interface to the $u->query_form data. | |
40 | ||
40 | (TBT) | |
41 | 41 | |
42 | 42 | =begin original |
43 | 43 | |
44 | 44 | The query_param_* methods have deliberately been made identical to the |
45 | 45 | interface of the corresponding C<CGI.pm> methods. |
46 | 46 | |
47 | 47 | =end original |
48 | 48 | |
49 | query_param_* | |
49 | The query_param_* methods have deliberately been made identical to the | |
50 | ||
50 | interface of the corresponding C<CGI.pm> methods. | |
51 | (TBT) | |
51 | 52 | |
52 | 53 | =begin original |
53 | 54 | |
54 | 55 | The following additional methods are made available: |
55 | 56 | |
56 | 57 | =end original |
57 | 58 | |
58 | ||
59 | The following additional methods are made available: | |
60 | (TBT) | |
59 | 61 | |
60 | 62 | =over |
61 | 63 | |
62 | 64 | =item @keys = $u->query_param |
63 | 65 | |
64 | 66 | =item @values = $u->query_param( $key ) |
65 | 67 | |
66 | 68 | =item $first_value = $u->query_param( $key ) |
67 | 69 | |
68 | 70 | =item $u->query_param( $key, $value,... ) |
69 | 71 | |
70 | 72 | =begin original |
71 | 73 | |
72 | 74 | If $u->query_param is called with no arguments, it returns all the |
73 | 75 | distinct parameter keys of the URI. In a scalar context it returns the |
74 | 76 | number of distinct keys. |
75 | 77 | |
76 | 78 | =end original |
77 | 79 | |
78 | $u->query_param | |
80 | If $u->query_param is called with no arguments, it returns all the | |
79 | URI | |
81 | distinct parameter keys of the URI. In a scalar context it returns the | |
80 | ||
82 | number of distinct keys. | |
83 | (TBT) | |
81 | 84 | |
82 | 85 | =begin original |
83 | 86 | |
84 | 87 | When a $key argument is given, the method returns the parameter values with the |
85 | 88 | given key. In a scalar context, only the first parameter value is |
86 | 89 | returned. |
87 | 90 | |
88 | 91 | =end original |
89 | 92 | |
90 | $key | |
93 | When a $key argument is given, the method returns the parameter values with the | |
91 | ||
94 | given key. In a scalar context, only the first parameter value is | |
92 | ||
95 | returned. | |
96 | (TBT) | |
93 | 97 | |
94 | 98 | =begin original |
95 | 99 | |
96 | 100 | If additional arguments are given, they are used to update successive |
97 | 101 | parameters with the given key. If any of the values provided are |
98 | 102 | array references, then the array is dereferenced to get the actual |
99 | 103 | values. |
100 | 104 | |
101 | 105 | =end original |
102 | 106 | |
103 | ||
107 | If additional arguments are given, they are used to update successive | |
104 | ||
108 | parameters with the given key. If any of the values provided are | |
105 | ||
109 | array references, then the array is dereferenced to get the actual | |
106 | ||
110 | values. | |
111 | (TBT) | |
107 | 112 | |
108 | 113 | =item $u->query_param_append($key, $value,...) |
109 | 114 | |
110 | 115 | =begin original |
111 | 116 | |
112 | 117 | Adds new parameters with the given |
113 | 118 | key without touching any old parameters with the same key. It |
114 | 119 | can be explained as a more efficient version of: |
115 | 120 | |
116 | 121 | =end original |
117 | 122 | |
118 | ||
123 | Adds new parameters with the given | |
119 | ||
124 | key without touching any old parameters with the same key. It | |
120 | ||
125 | can be explained as a more efficient version of: | |
126 | (TBT) | |
121 | 127 | |
122 | 128 | $u->query_param($key, |
123 | 129 | $u->query_param($key), |
124 | 130 | $value,...); |
125 | 131 | |
126 | 132 | =begin original |
127 | 133 | |
128 | 134 | One difference is that this expression would return the old values |
129 | 135 | of $key, whereas the query_param_append() method does not. |
130 | 136 | |
131 | 137 | =end original |
132 | 138 | |
133 | ||
139 | One difference is that this expression would return the old values | |
134 | query_param_append() | |
140 | of $key, whereas the query_param_append() method does not. | |
141 | (TBT) | |
135 | 142 | |
136 | 143 | =item @values = $u->query_param_delete($key) |
137 | 144 | |
138 | 145 | =item $first_value = $u->query_param_delete($key) |
139 | 146 | |
140 | 147 | =begin original |
141 | 148 | |
142 | 149 | Deletes all key/value pairs with the given key. |
143 | 150 | The old values are returned. In a scalar context, only the first value |
144 | 151 | is returned. |
145 | 152 | |
146 | 153 | =end original |
147 | 154 | |
148 | ||
155 | Deletes all key/value pairs with the given key. | |
149 | ||
156 | The old values are returned. In a scalar context, only the first value | |
150 | ||
157 | is returned. | |
158 | (TBT) | |
151 | 159 | |
152 | 160 | =begin original |
153 | 161 | |
154 | 162 | Using the query_param_delete() method is slightly more efficient than |
155 | 163 | the equivalent: |
156 | 164 | |
157 | 165 | =end original |
158 | 166 | |
159 | query_param_delete() | |
167 | Using the query_param_delete() method is slightly more efficient than | |
160 | ||
168 | the equivalent: | |
169 | (TBT) | |
161 | 170 | |
162 | 171 | $u->query_param($key, []); |
163 | 172 | |
164 | 173 | =item $hashref = $u->query_form_hash |
165 | 174 | |
166 | 175 | =item $u->query_form_hash( \%new_form ) |
167 | 176 | |
168 | 177 | =begin original |
169 | 178 | |
170 | 179 | Returns a reference to a hash that represents the |
171 | 180 | query form's key/value pairs. If a key occurs multiple times, then the hash |
172 | 181 | value becomes an array reference. |
173 | 182 | |
174 | 183 | =end original |
175 | 184 | |
176 | ||
185 | Returns a reference to a hash that represents the | |
177 | ||
186 | query form's key/value pairs. If a key occurs multiple times, then the hash | |
187 | value becomes an array reference. | |
188 | (TBT) | |
178 | 189 | |
179 | 190 | =begin original |
180 | 191 | |
181 | 192 | Note that sequence information is lost. This means that: |
182 | 193 | |
183 | 194 | =end original |
184 | 195 | |
185 | ||
196 | Note that sequence information is lost. This means that: | |
186 | ||
197 | (TBT) | |
187 | 198 | |
188 | $u->query_form_hash($u->query_form_hash) | |
199 | $u->query_form_hash($u->query_form_hash) | |
189 | 200 | |
190 | 201 | =begin original |
191 | 202 | |
192 | 203 | is not necessarily a no-op, as it may reorder the key/value pairs. |
193 | 204 | The values returned by the query_param() method should stay the same |
194 | 205 | though. |
195 | 206 | |
196 | 207 | =end original |
197 | 208 | |
198 | ||
209 | is not necessarily a no-op, as it may reorder the key/value pairs. | |
199 | ||
210 | The values returned by the query_param() method should stay the same | |
200 | ||
211 | though. | |
201 | ||
212 | (TBT) | |
202 | 213 | |
203 | 214 | =back |
204 | 215 | |
205 | 216 | =head1 SEE ALSO |
206 | 217 | |
207 | 218 | L<URI>, L<CGI> |
208 | 219 | |
209 | 220 | =head1 COPYRIGHT |
210 | 221 | |
211 | 222 | Copyright 2002 Gisle Aas. |
212 | 223 | |
213 | 224 | =begin meta |
214 | 225 | |
215 | Translate: SHIRAKATA Kentaro <argrath@ub32.org> (1.35 | |
226 | Translate: SHIRAKATA Kentaro <argrath@ub32.org> (1.35) | |
216 | Status: | |
227 | Status: in progress | |
217 | 228 | |
218 | 229 | =end meta |
219 | 230 | |
220 | 231 | =cut |