Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#an FTP get my $ua; $ua = LWP::UserAgent->new(); $ua->agent("$0/0.1 ".$ua->agent); my $req = HTTP::Request->new(GET => "$url"); my $result = $ua->request($req);
#an FTP put #open the file and read the contents my $content; if (open DATA_READER, "$data_file") { $content = join ("", <DATA_READER>); close DATA_READER; } else { warn "UNABLE TO READ $data_file, upload will be empty! $!\n"; } my $ua; $ua = LWP::UserAgent->new(); $ua->agent("$0/0.1 ".$ua->agent); my $req = HTTP::Request->new('PUT',"$url",undef,"$content"); my $result = $ua->request($req);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Less Memory for LWP/FTP
by Corion (Patriarch) on Dec 02, 2003 at 14:21 UTC | |
|
Re: Using Less Memory for LWP/FTP
by iburrell (Chaplain) on Dec 02, 2003 at 21:27 UTC | |
by Anonymous Monk on Dec 04, 2003 at 13:17 UTC | |
|
Re: Using Less Memory for LWP/FTP
by Art_XIV (Hermit) on Dec 02, 2003 at 14:14 UTC |