<div>Hi All </div>
<div> </div>
<div>Thanks for your reponses. You're right - using a scalarref is what I needed. My source data was following a pattern similar to Grant's - uncompressing a base 64 decoded string. IO::Uncompress::Inflate is what worked for me rather than the RawInflate version</div>

<div> </div>
<div>Dan<br><br></div>
<div class="gmail_quote">On 15 November 2012 10:15, Grant McLean <span dir="ltr"><<a href="mailto:grant@mclean.net.nz" target="_blank">grant@mclean.net.nz</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div class="im">On Thu, 2012-11-15 at 09:53 +1300, Dan Horne wrote:<br>> Hi Mongers<br>><br>> I'm trying to convert a Python routine to Perl. The point where I'm<br>> stuck is where I need to decompress a string. The Python code is<br>
> something like (extraneous code removed)<br><br></div>I fought with something similar to this a while ago. The key detail that<br>I was missing is the difference between gzip and inflate/deflate.  My<br>understanding is that they are both implemented in zlib but gzipping<br>
adds some envelope around the raw deflated data.<br><br>I ended up using the IO::Uncompress::RawInflate module because I found a<br>code example that worked in my situation (I was dealing with an XML<br>document that had been compressed and then base64 encoded and then URL<br>
encoded).  Despite the 'IO::' prefix, this module does work with<br>in-memory strings.  The relevant snippet is here:<br><br><a href="https://metacpan.org/source/GRANTM/Authen-NZigovt-1.05/lib/Authen/NZigovt/AuthenRequest.pm#L202" target="_blank">https://metacpan.org/source/GRANTM/Authen-NZigovt-1.05/lib/Authen/NZigovt/AuthenRequest.pm#L202</a><br>
<br>Hope that helps<br><span class="HOEnZb"><font color="#888888">Grant<br></font></span>
<div class="HOEnZb">
<div class="h5"><br>_______________________________________________<br>Wellington-pm mailing list<br><a href="mailto:Wellington-pm@pm.org">Wellington-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/wellington-pm" target="_blank">http://mail.pm.org/mailman/listinfo/wellington-pm</a><br>
</div></div></blockquote></div><br>