|Just another Perl shrine|
How to determine if 'strict' is enabledby kcott (Archbishop)
|on Jun 07, 2023 at 01:59 UTC||Need Help??|
kcott has asked for the wisdom of the Perl Monks concerning the following question:
I'm doing some testing of Perl::Dist::APPerl on various platforms. I have a test script which currently checks that 'use v5.36;' enables the warnings pragma and features are enabled or disabled as appropriate.
I'm looking for a platform-independent way to determine if the strict pragma is in effect without forcing an abort.
If strict is specifically used, it can be determined from %INC:
However, if strict is enabled automatically via use VERSION (where VERSION >= 5.12), this method doesn't work:
Any help with this would be appreciated. Thankyou.