in reply to Arrays: More than one word

If you're using CGI.pm, it has URI (as well as HTML) encoding and decoding included, though you have to request them by name. From Master Stein's page:

escape(), unescape()

     use CGI qw/escape unescape/;
     $q = escape('This $string contains ~wonderful~ characters');
     $u = unescape($q);

http://stein.cshl.org/WWW/software/CGI/cgi_docs.html