perlversionwarningsperl5.10

What is here the recommended way the get rid of the "v-string in use/require non-portable" warning?


A module requires at least Perl 5.10.0.

When I use this module with Perl version 5.10.0 I get the warning:

v-string in use/require non-portable at ... (line of "use 5.10.0;").

In Perl 5.10.1 this warning is removed.

What would be the recommended way to avoid the warning:

- change all "use 5.10.0" in the distro to "use 5.010_000;"

- add "no warnings 'portable';" to the module

- leave it to the user of Perl 5.10.0 to add "no warnings 'portable';"

- Increase the smallest required version to 5.10.1. 

perl -wE 'use 5.10.0; say $^V'
# v-string in use/require non-portable at -e line 1.
# v5.10.0

Solution

  • If you want anything from 5.10.0 and later, you don't need to specify a minor version:

    use v5.10;
    

    You might consider using at least 5.10.1, which had some significant changes to the earlier minor version (including fixing your warning):

    use v5.10.1;
    

    But, give us a sample program, show use which Perl you're using and all that other stuff.