in reply to Abort page load and redirect?
First, check if you are not printing anything before. If not, here are two ideas: add an exit after the location print statement. Other idea, why not to use CGI.pm and its redirect function?
Alberto Simões
In Section
Seekers of Perl Wisdom