I bumped into this snip on perlmonks.
 
http://www.perlmonks.org/?node_id=621885
    >> my $browser = LWP::UserAgent->new();
    >> my $response = $browser->request($request, \&sendthis);
Its pretty nice way to post large datafiles via without buffering
hundreds of megs in local RAM.  I hadn't thought of this from the
perldoc.
>From the perldoc LWP::UserAgent
>> $ua->request( $request, $content_cb, $read_size_hint )
But, it doesn't work :(
HTTP::Message doesnt allow you to add content that is of non scalar
reference.
LWP::Protocol::http only uses the request content from HTTP::Message (
it mostly ignores arg[1] from the origial request call )
Even if HTTP::Message could take something like $request->content(
\&code ) the http.pm would die suddenly from this.
 >> $content_ref = $$content_ref if ref($$content_ref);

  unbelievably, four lines after this  it says:

 >> if ( ref($content_ref) eq 'CODE' ))

... if that statement would ever be true, the previous statement would
be a run time error ..

Anywhoo,  for those that are amused, attached are a couple lame patches
that seem to work.

 

 

Attachment: http10.pm-patch
Description: http10.pm-patch

Attachment: http.pm-patch
Description: http.pm-patch

Reply via email to