in reply to Can't decompress zlib compression stream with Compress:Zlib

Been trying for months to get it working. Any ideas?

Yes. (And I don't often say this so emphatiocally.) LEARN TO USE STRICT AND WARNINGS IN YOUR CODE! It'll save you "trying for months"!!!

The call to Compress::Zlib->inflate at line 158 does not decompress anything for reasons unknown.

The code in line 158 is: my ($nout, $status) = $y->inflate($s->{buf}) but there is no other reference to a variable $y in the entire script.

And that is just one of the bugs strict and warnings would throw in your face help you find.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Can't decompress zlib compression stream with Compress:Zlib
by Anonymous Monk on Oct 04, 2016 at 11:47 UTC

    I removed 'use strict' and 'use warnings' because they throw up a load of unrelated error messages. The $y is a typo and should be $zlib.

      I removed 'use strict' and 'use warnings' because they throw up a load of unrelated error messages

      “Big mistake. Big. Huge. I have to go shopping now.” :)

      The $y is a typo and should be $zlib.

      Yup ... (not quite sure how 'y', is a "typo" of 'zlib'; but whatever...) Exactly (part of) what strict & warnings saves you from.

        Not such a big mistake, I hope.

        I can post a 5000-line script with 'use strict' or a 200-line script without it, but it won't get us any closer to discovering why Compress::Zlib->inflate does not work.