Tuesday 23 October 2007

Producing encoded URLs with CGI.pm

I was in need of some URLs with the special characters (like space, & etc) escaped. They contain parameters that are being read from a database which are text search strings.

It turns out that the escape() function in CGI.pm will do what is needed - but it's not a standard function that is available when you just use CGI. You have to

use CGI qw/escape /;

to make the function available.

No comments: