What are the consequences of explicitly "use"-ing various Perl versions?

Viewed 59

I'm learning Perl and don't have much experience with the defaults and changes in more recent versions. For example, I put use v5.10; at the beginning of all of my scripts (even though I have version 5.28.1 installed) so that I can safely use the say() function. Apparently "use"-ing v5.12 will enable strict by default.

What other changes does "use"-ing v5.10 or v5.12 make? What changes do more recent versions make? Is there a commonly used version for personal or open-source projects?

1 Answers

The effects of using a specific minimum version are documented in https://perldoc.perl.org/feature#FEATURE-BUNDLES . In short, the newer features are enabled and strictness checks are turned on.

Here is an excerpt of the page:

bundle    features included
--------- -----------------
:default  indirect

:5.10   say state switch indirect

:5.12   say state switch unicode_strings indirect
        [also does the equivalent of use strict;]
[...]
:5.28   say state switch unicode_strings
        unicode_eval evalbytes current_sub fc
        postderef_qq bitwise indirect
        [also does the equivalent of use strict;]

:5.30   say state switch unicode_strings
        unicode_eval evalbytes current_sub fc
        postderef_qq bitwise indirect
        [also does the equivalent of use strict;]

:5.32   say state switch unicode_strings
        unicode_eval evalbytes current_sub fc
        postderef_qq bitwise indirect
        [also does the equivalent of use strict;]
Related