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;
In reply to Re^3: HTTP response buffer
by Corion
in thread HTTP response buffer
by nevafuse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |