Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: LWP file transfer running out ot memory on a whopping big file

by gav^ (Curate)
on Feb 07, 2002 at 13:56 UTC ( [id://143871]=note: print w/replies, xml ) Need Help??


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'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://143871]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found