Ville Skytt� <[EMAIL PROTECTED]> writes:
> How about an option to someway tell query_param to use (if not default
> to) ";" as the separator in query strings instead of "&"?
I actually thought a bit about that when I did URI::QueryParam, but I
did not manage to come up with an API that I liked. So I just ignored
it in the end.
Some have suggested that $u->query_form should just split on both
[&;]. I have two problems with that; 1) I'm not totally convinced
that URIs like ?foo=1;2;3&bar=1 does not exist and 2) how do we know
what to use for joining parameters.
One possibility is to have a global variable that decide what the
split char is. That seems to be the route that CGI.pm has taken.
This has action-at-distance problems.
Another possibility is simply to have an additional set of methods
that operate with ";" as param separator. This is kind of ugly as the
URI::QueryParam has to be duplicated as well.
Since $u->query_form currently must take an even number of arguments
we could let it discover when passed an odd number of arguments and
then shift (or pop) off one of them and use that as the separator.
@semi_split = $u->query_form(";")
$u->query_form(";", a => 1, b => 2);
A problem with the last one is that it overgeneralizes a bit and how
to manage to pass the ";" through the URI::QueryParam interface.
Regards,
Gisle
> More info:
> - <http://www.w3.org/TR/html401/appendix/notes.html#h-B.2.2>
> - use CGI qw(-newstyle_urls);