in reply to Re^2: HTTP response buffer
in thread HTTP response buffer

You should binmode the file after opening it. I wouldn't reopen the file on every run through:

open my $fh, '>', $filename or die "Couldn't create '$filename': $!"; binmode $fh; $browser = LWP::UserAgent->new(); my $resp = $browser->get($url,':content_cb' => sub { my($data, $resp) = @_; print $fh $data; return; },':read_size_hint' => 1024); close $fh;

Replies are listed 'Best First'.
Re^4: HTTP response buffer
by nevafuse (Novice) on Feb 23, 2009 at 21:21 UTC
    I love you?