http://www.perlmonks.org?node_id=621871

mifflin has asked for the wisdom of the Perl Monks concerning the following question:

I have client that wants me to send him a file via http.
The potential problem here is this file may be rather large (megabytes).
The usual way that I send data through http is via the POST method like...
my $headers = HTTP::Headers->new(); $headers->header('Content-Type' => 'text/plain; charset=utf-8'); $headers->header('Content-Length' => length($sendthis)); my $request = HTTP::Request->new('POST', $url, $headers, $sendthis) +; $request->protocol('HTTP/1.1'); my $browser = LWP::UserAgent->new(); my $response = $browser->request($request); my $gotthis = $response->content();
This works but can result it memory issues if the variable $sendthis is large.
Is there a better way to send large files via http?