http://qs321.pair.com?node_id=12023


in reply to Encode a string to be suitable for a URL

The package URI::Escape will do the encoding and decoding for you.