in reply to Follow Redirect Before Accessing Web Content

I recommend WWW::Mechanize - it transparently follows redirects and behaves more like a browser. If you want to do it by hand, you have to check the return code you get in $res and check manually whether it's an error (you should do that!), a result (2xx) or a redirect (3xx).