in reply to LWP::UserAgent hacking

As long as LWP doesn't support chunked responses (I think it still doesn't), this will work:
my $content_length = $response->content_length;