<div>Hi Mongers</div>
<div> </div>
<div>I'm trying to convert a Python routine to Perl. The point where I'm stuck is where I need to decompress a string. The Python code is something like (extraneous code removed)</div>
<div> </div>
<div>import zlib</div>
<div>mystring = '<value from previous function>'</div>
<div>print zlib.decompress(mystring)</div>
<div> </div>
<div>However, it's not clear to me how to replicate this in Perl. I've tried</div>
<div> </div>
<div>use Compress::Zlib;</div>
<div>my $mystring = '<value from previous function>';</div>
<div>my $x = deflateInit();<br>my ($out,$status) = $x->deflate($mystring );<br>$status == Z_OK or die "deflation failed\n";</div>
<div>print $out;</div>
<div> </div>
<div>Unfortunately, the Perl code doesn't work - $out is gobbledygook -- and as far as I can tell from the doco, Compress::Zlib seems to be interested in decompressing filehandles not strings. Any advice on how to decompress a string appreciated</div>

<div> </div>
<div>Dan</div>