in reply to common replacement code ill-understood
You can use CGI to decode parameters, but it won't decode the main url part. CGI doesn't have a generic %-unescape routine.
To escape and unescape URI/URL escape characters, use URI::Escape. A very handy module.
If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong. That way everyone learns.