Sorry, I guess I should have showed you the headers...
I am using CGI.pm: use CGI qw(:standard :cgi-lib escapeHTML);
I guess I could just have the part where it prints the html link instead of putting &q=$_query I _could_ put a placeholder like &q={{replace_query}} then _after_ I Have it replace all the text then replace that with the original query. That just seems like a 'broken' way to do it. What do you think?