Hi all,

I've tried the following script for downloading a file and it works fine if
the file size is not too big.

But if the file is very large, the computer gets out of memory.
Can you tell me how to do it?

Thank you.

Here is the part of my script:

my $ua = LWP::UserAgent -> new(env_proxy => 0,
timeout => 50,
keep_alive => 1,
);

my $request = HTTP::Request -> new('GET', $location);
my $response = $ua -> request($request);

my $content = $response -> content;

#...
open (OUT, ">$save_dir/$file") or die "Can't write to $save_dir/$file - $!";
binmode OUT;
print OUT $content;
close OUT;

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]


Reply via email to