in reply to "use VERSION does not load the feature.pm, strict.pm, or warnings.pm"
Perhaps the part that is confusing you is that "load strict.pm file" is completely different from "enable strictures". You can enable strictures by changing the magic variable $^H during a BEGIN block, and get all the benefits of strict without actually using the file "strict.pm".
So... does this mean? If I "use v5.28" do I still need "use strict"?
In short, No.
The only difference that "use strict" gives vs. the strictures you get from "use v5.28" are that the global %INC will have an entry for "strict.pm", and the global symbol table %main::strict:: will have stuff in it, and you get the option of calling BEGIN { strict->import }. That last snippet would fail if nothing in your script ever loaded strict.pm.
On the upside, if every module switched from "use strict" to "use v5.28" you would save 0.0001 seconds of startup time by not needing to stat/open/read strict.pm.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "use VERSION does not load the feature.pm, strict.pm, or warnings.pm"
by almr (Beadle) on Apr 30, 2024 at 17:01 UTC | |
by hv (Prior) on Apr 30, 2024 at 17:33 UTC | |
by NERDVANA (Priest) on Apr 30, 2024 at 17:31 UTC |