in reply to Switching out characters inside links

You need to convert the non-HTML (the url) into HTML *before* inserting it into the document.
use HTML::Entities qw( encode_entities ); my $url = 'http://www.somedomain.com/index.cgi?page=home&var=1&no=2&so +=forth&so=on'; my $h_url = encode_entities($url); print(qq{...<a href="$h_url">...</a>...};

Using Template-Toolkit, you'd use something like

...<a href="[% url | html %]">...</a>...