|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
(dkubb) Re: (2) Oops! (Query String messed up)by dkubb (Deacon) |
| on Mar 12, 2001 at 09:20 UTC ( [id://63790]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Well, you could use a regex to URL encode all the elements in your URL parameters, then join them together into a single query string. But, there is a much simpler way, using the CPAN module URI. Below is an example program using URI that does something similar to what you want:
A well formed URL will be printed out, and any parameters will be URL encoded properly. A nice bonus is that the code made with URI is easy to read and hides all the potentially messy URL construction/encoding details from you. I almost never work with URL's by hand any longer since I started to use this module.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||