When it come to saying what version of Perl we need for our scripts, we\'ve got options, oh, brother, we\'ve got options:
use 5.010;
use 5.010_001;
use 5.10.0;
u
The "modern" way is to use the forms starting with v
. However, that may not necessarily be what you really want to do.
Critic complains because older versions of Perl won't understand and play nicely with the forms that start with v
. However, if your version of Perl supports it, v
is nicer to read because you can say:
use v5.10.1;
... rather than ...
use 5.010_001;
So, in the documentation for use, the following workaround is offered:
use 5.006; use v5.6.1;
NB: I think the documenation is in error here, as the v
is omitted from the example at perldoc use
.
Since the versions of Perl that don't support the v
syntax will fail at the first use
, they won't get to the second more specific and readable one.