in reply to Re^2: URL redirection
in thread URL redirection

So, the most likely cause is that you or your script output something else before the redirect is printed, because, as you see in the output, the Location: header is there. Run your script on the command line to see what it outputs, or use the GET command from LWP to see what your script outputs:

GET -USe http://...

... or alternatively, debug what is output via telnet.