in reply to LWP file transfer running out ot memory on a whopping big file

If you type perldoc lwpcook or go here you will find loads LWP examples including one about handling large documents.

A quick copy paste is:

use LWP::UserAgent; $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => 'http://www.linpro.no/lwp/libwww-perl-5.46.tar.gz'); $res = $ua->request($req, "libwww-perl.tar.gz"); if ($res->is_success) { print "ok\n"; } else { print $res->status_line, "\n"; }

gav^

  • Comment on Re: LWP file transfer running out ot memory on a whopping big file
  • Download Code

Replies are listed 'Best First'.
Re: Re: LWP file transfer running out ot memory on a whopping big file
by adamsj (Hermit) on Feb 07, 2002 at 14:17 UTC
    It's workin' like a charm--thanks!

    for ($i = 0; $i < 1000; $++) { print "I _will_ remember to read lwpcook as part of the lwp docum +entation.\n"; }

    adamsj

    They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen

      for ($i = 0; $i < 1000; $++)

      Whoopsie, you forgot an 'i'.

      print "I wll remember my i's\n" for ( 0..999);
      Couldn't resist ;)

      blyman
      setenv EXINIT 'set noai ts=2'