8 ms·
It does look like it's invoking a specific Perl version, but the version of Perl you use will be the one available in your path. When you say "use v5.40;" you a
by oalders 2y ago
It does look like it's invoking a specific Perl version, but the version of Perl you use will be the one available in your path. When you say "use v5.40;" you are enabling a "feature bundle" that the language makes available as of that version.
https://perldoc.perl.org/feature#FEATURE-BUNDLES https://perldoc.perl.org/feature#FEATURE-BUNDLES
For example "use v5.40;" is shorthand for
use feature qw(
bitwise
current_sub
evalbytes
fc
isa
module_true
postderef_qq
say
signatures
state
try
unicode_eval
unicode_strings
);
(It also does a "use strict").
It's a way to make new builtin language features easily available without turning them on by default.
If you try to import a feature bundle which is greater than the version of Perl you're currently running, the code will not compile:
> Perl v5.40.0 required--this is only v5.34.0, stopped at foo.pl line 1