in reply to Re^4: Can't decompress zlib compression stream with Compress:Zlib
in thread Can't decompress zlib compression stream with Compress:Zlib

I can post a 5000-line script with 'use strict' or a 200-line script without it

Are you seriously saying that you think it would require you to add 4800 lines -- +2500% -- to make your code strict and warnings compliant?

If so, wow. Where on earth did you get such a grossly mistaken impression?

Once I corrected s/$y/$zlib/, I ran perl -C on your code and got:

C:\test>perl -c junk1.pl Global symbol "$EINTR" requires explicit package name at junk1.pl line + 133. Global symbol "$EINTR" requires explicit package name at junk1.pl line + 134. Global symbol "$EINTR" requires explicit package name at junk1.pl line + 177. Global symbol "$EINTR" requires explicit package name at junk1.pl line + 178. junk1.pl had compilation errors.

So then I added our $EINTR; at the top and got:

C:\test>perl -c junk1.pl junk1.pl syntax OK

And if your response to corion is correct and making the first change (which strict & warnings would have found for you), and your code worked, then is typing one extra line to make your code S&M compliant too much work to save you "months" of frustration?


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^6: Can't decompress zlib compression stream with Compress:Zlib
by Anonymous Monk on Oct 04, 2016 at 13:55 UTC

    You seem to have misunderstood. To reduce 5000+ lines of code to 200, I used Net::Telnet as a base class, rather than including all 6168 lines of Net::Telnet code in my original post.

    I'm not the author of Net::Telnet, so I'm not in a position to easily explain its deficiencies, if any, if we add 'use' directives to the original code.

      I'm not the author of Net::Telnet, so I'm not in a position to easily explain its deficiencies, if any, if we add 'use' directives to the original code.

      But there is no need for that. What I did was placed the use strict & warnings lines after the other includes.

      That way, it only applies to your code, not that of the modules you use.


      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.

        That approach didn't occur to me.

        Are you saying that "use warnings; use strict; use Module;" would turn on strict and warnings in Module.pm?