in reply to Out of memory while using LWP::UserAgent
Search for content_cb and content_file in perldoc LWP::UserAgent. This shows how you can write the data to a file or process it with a callback instead of writing to a perl scalar.