in reply to Re^4: Uncompress streaming gzip on the fly in LWP::UserAgent/WWW::Mechanize
in thread Solved: Uncompress streaming gzip on the fly in LWP::UserAgent/WWW::Mechanize
Sorry if I completely misunderstood the problem, but won't the following work?
use strict; use warnings; use feature 'say'; use IO::Compress::Gzip 'gzip'; use IO::Uncompress::Gunzip qw/ gunzip $GunzipError /; my $s = <<'END'; I include only the bare bones because I tried something like 20 differ +ent things without success and I'm embarrassed. :( Non-streaming requ +ests are working perfectly with approximately this code. The endpoint + for this code is a END gzip( \$s, \my $c ); my @chunks = unpack '(a42)*', $c x 5; my $partial = ''; my $result = ''; my $n = 1; for ( @chunks ) { gunzip( \( $partial . $_ ), \my $o, Transparent => 0, TrailingData + => my $t ); $partial .= $_ and next if $GunzipError; $partial = $t ? $t : ''; print "message #", $n ++, "\n$o"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Uncompress streaming gzip on the fly in LWP::UserAgent/WWW::Mechanize
by pmqs (Friar) on Dec 19, 2018 at 22:16 UTC | |
by vr (Curate) on Dec 19, 2018 at 23:09 UTC | |
by pmqs (Friar) on Dec 20, 2018 at 13:52 UTC |