See the section "Large Documents" in perldoc lwpcook.
In reply to Re: Out of memory while using LWP::UserAgent by Fletch in thread Out of memory while using LWP::UserAgent by ezekiel