in reply to examples using Compress::Zlib ?
Did you see the examples in the Compress::Zlib docs? They have some examples of using gzopen, gzwrite, gzread, etc.