Yesterday I spent a few hours banging my head against a brick wall. I'm using
PerlIO::gzip on ActiveState Perl 5.8.8 to decompress a large XML file. The XML file decompresses perfectly with Cygwin's gzip or xmllint, but
PerlIO::gzip sometimes mangles the file and it starts as XML then degenerates into soup and sometimes it decompresses the file perfectly.
I wasted quite a few hours thinking it was something else, but it's clearly a random problem with
PerlIO::gzip, sometimes it works and sometimes it doesn't. I can't make any sense of it, how can it work some of the time and the rest of the time it generates gibberish?
I'm going to give
IO::Uncompress::Gnuzip a go now to see if it's consistent and reliable. It's a shame as the
PerlIO::gzip interface was very handy.