http://www.perlmonks.org?node_id=906885


in reply to URL Redirect (header already there)

You answered your own question if you just think about it: printing the redirect after the header doesn't work, so you need to determine what you want to do first then print the corresponding response (normal headers or a redirect). You also might want to take a look at something like CGI::Application which provides a more structured approach that aides in separating presentation and logic.

The cake is a lie.
The cake is a lie.
The cake is a lie.