in reply to Re: Exporting use strict/warnings into main::
in thread Exporting use strict/warnings into main::

Completely agree. Importing strict into somebody else's code is rather presumptuous. Sure, certain packages do it, but they are rather lower-level than this utility.


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^3: Exporting use strict/warnings into main::
by haukex (Archbishop) on May 19, 2020 at 06:47 UTC

      Yes, that's exactly my point. All of those are frameworks on which you build an app, so it's appropriate to have them export things like strict into the caller's namespace. The OP's utility does not fit that category.


      The way forward always starts with a minimal test.
        Yes, that's exactly my point. All of those are frameworks ...

        Ah, I see, I thought with "lower-level" you meant modules like strictures or Modern::Perl, which is why I didn't list those.

        The OP's utility does not fit that category.
        It doesn't? That module is a special purpose utility with a rich DSL. So, the module does define its own rules. It is rather unlikely that someone casually uses it and all of a sudden trips over strict.
Re^3: Exporting use strict/warnings into main::
by haj (Vicar) on May 19, 2020 at 10:07 UTC

    I'd say that importing strict into your caller's scope is acceptable if the package in question defines the way you write your code anyway, like the examples given by haukex do, but presumptuous in an ordinary OO package. But maybe that's what you mean with "lower-level".

      Precisely.


      The way forward always starts with a minimal test.