3 ms·
I'm not actually familiar with Perl but viewed this out of curiosity, I had no idea you specify the version number as an import. What happens if the version num
by politelemon 2y ago
I'm not actually familiar with Perl but viewed this out of curiosity, I had no idea you specify the version number as an import. What happens if the version number doesn't exist, does it fallback to nearest?
- oalders 2y agoIt 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