in reply to Lost in compressed encodings
You are overwriting the file handle $in with the newly created by IO::Uncompress::Gunzip. I can't tell the consequences, but it does not look sane to me.
Greetings,-jo