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 different things without success and I'm embarrassed. :( Non-streaming requests 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"; }