I am using LWP::UserAgent to retreive files from a FTP site. Everything appears to work fine until I attempt to get a file that is supposedly 65M in size. At this point the script dies with error:
"Out of memory during "large" request for 134221824 bytes, total sbrk() is 271669258 bytes at .."
The code I am using is below. I know the physical memory is available. Any thoughts on how to get around this problem? Thanks in advance.
my $ua = LWP::UserAgent->new();
my $response = $ua->get("$url");
if ($response->is_success) {
my $content = $response->content;
open (OUTPUT, ">out.txt") or die "Cannot open the output file: $!"
+;
print OUTPUT "$content";
close (OUTPUT) or die "Cannot close the output file: $!";
}
else {
die $response->status_line;
}