This is what's wrong:
location: http://redirected_url
Location, like all other HTTP headers, must have the first letter capitalized. The reason it isn't is that you asked CGI to add a header called 'location' with that url as the content. Here are the examples from the CGI documentation:
print $query->redirect('http://somewhere.else/in/movie/land');
print $query->redirect(-uri=>'http://somewhere.else/in/movie/land',
-nph=>1);
Note that
uri is the correct named parameter, or the URI may be passed as the sole parameter.
--isotope