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

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.

  • Comment on Re^6: Can't decompress zlib compression stream with Compress:Zlib

Replies are listed 'Best First'.
Re^7: Can't decompress zlib compression stream with Compress:Zlib
by BrowserUk (Patriarch) on Oct 04, 2016 at 13:57 UTC
    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?

        Take a look at the embedded package in the OP code.

        I'm saying that coded this way:

        #! perl -sl use strict; use warnings; X::test(); { package X; $FRED = 'fred'; sub test { print 'This is package:', __PACKAGE__; } 1; }

        The strict & warnings affect that embedded package:

        C:\test>perl -c test.pl Global symbol "$FRED" requires explicit package name at test.pl line 1 +0. test.pl had compilation errors.

        But coded this way:

        #! perl -sl { package X; $FRED = 'fred'; sub test { print 'This is package:', __PACKAGE__; } 1; } use strict; use warnings; X::test();

        They do not:

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

        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.