in reply to Which pragmas are activated with a specific perl version?

warnings is not included by use VERSION (I learned this the hard way, when I ignored a bug because "it can't happen, warnings would have told me") as demonstrated by:

perl -e "use v5.12; my @b; $a = @b[0]" perl -e "use warnings; my @b; $a = @b[0]" Scalar value @b[0] better written as $b[0] at -e line 1. Name "main::a" used only once: possible typo at -e line 1.

According to Implicit strictures, use VERSION is equivalent to use strict; use feature ':VERSION';, and I don't think anything as been added since. So you can have the list of what is included by looking in %feature::feature_bundle (you can look at the code of feature for more info on that)

Edit: "use VERSION does not load the feature.pm" as quoted by LanX, so %feature::feature_bundle isn't available unless you explicitly call use feature...

Replies are listed 'Best First'.
Re^2: Which pragmas are activated with a specific perl version?
by KurtZ (Friar) on Mar 15, 2018 at 12:55 UTC
    " warnings is not included by use VERSION“ Why?

      I don't know, it can't be for retro compatibility reasons because use VERSION is about stating that the code isn't retro compatible anyway. And there is a command switch to enable warnings (-w) but none to enable strict (though -Mstrict would work), I don't know if this is connected.

        OK thank you. Would be interesting to know the background, though.