in reply to reversible pack()?

Your code tries to memGunzip $code before packing it. pack it before uncompressing it. Replace your final line of code like so...

print Compress::Zlib::memGunzip( pack 'H*', $code );

and you are unzipping the packed $code.

HTH