in reply to Re^2: Backdating strict
in thread Backdating strict

That does sound like the best way forward for me...enforce strict initially one subroutine at a time then one lexical block at a time until the complete code unit has strictures enforced.

Quick question...
If I have use strict; followed by a require statement in the same block, does the code that is brought in by the require have strict applied to it - my guess is yes as it is in the same lexical block.

I can't test it right now as I am using my mobile and AFAIK there isn't a version of Perl for Android.

Replies are listed 'Best First'.
Re^4: Backdating strict
by jcb (Parson) on Nov 20, 2020 at 02:49 UTC

    No, code brought in with use or require is its own top-level lexical scope.

    Explained differently, lexical scopes do not cross file boundaries in Perl; the loading mechanism is not a preprocessor.

    If this were not so, the common convention of making use strict; the first statement in a script would also apply strict to all library modules, but this does not happen.

Re^4: Backdating strict
by marto (Cardinal) on Nov 19, 2020 at 17:55 UTC

    I've not used this in a while, perhaps worth checking out.

      Thanks marto - that looks rather interesting!

      I was right...it is very interesting and now I have a newer version of Perl - 5.32 on my mobile than I do on my laptop or webserver!!! Somehow that doesn't seem quite right but some things are best left unquestioned :)

      Thanks for the information marto