Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
As merlyn has pointed out, there isn't really a bug here, just some confusion about how to use the method. (Personally, I would consider this a documentation bug) The POD doesn't really say what it returns, just that... This method sets and returns query components that use the application/x-www-form-urlencoded format. Key/value pairs are separated by "&" and the key is separated from the value with a "=" character. It's easy to see how you could interpret that to mean that it returns a hash (which is what most people think of when they think of "pairs") ... but the truth is it accepts multiple key=>val pairs with the same key as input, and returns multiple key=>val pairs with the same key as output...
...when you slurp the output into a hash, you are ignoring all but one pair with the same key. As I said, I would consider this a documentation bug, because I don't think the POD is very clear, but the method is doing what it says. For future refrence, when I looked at the bug you filed, i noticed it was marked "Fixed in 1.22 added" .. so i took a look at the Changelog for that rev, which mentions the new addition of URI::QueryParam. Looking at the Docs for that module was very enlightening. Using it adds a lot of methods to URI objects that look closer to what you want...
In reply to Re: URI.pm bug or am i missing something?
by hossman
|
|