use CGI; my $cgi = CGI->new; print $cgi->header(-location => "http://www.mysite.com/$URL");