I never cease to be amazed at how as simple a protocol as HTTP requires such complex code to implement correctly, and even how hard it is to decide what "correctly" means. Last night I was rooting around in LWP/UserAgent.pm trying to fix a problem that was basically this: This one web site needs certain cookies which it uses for a session ID. But if the session ID is old enough, it wants to change the cookies. So you access page X, it sees you have an old session ID, it HTTP-redirects you to page Y, the response to which is just setting a new cookie and HTTP-redirecting you to page X, which this time succeeds. LWP/UserAgent.pm thinks that's a loop, and won't obey the redirection from page Y, because why would you want to hit a URL that you were just redirected away from? So I have to add code that implements the idea that Oh, but THIS time you'll have a different cookie, so it'll be probably be okay! Sheer lunacy. But necessary.