in reply to Redirect Eliminate

Maybe you should not only print a Location header, but also a Status: 302 Found?

If you're not all that familiar with HTTP, using CGI isn't a bad idea:

use CGI; print CGI->new->redirect($ToUrl);