is_strict#
Test whether a string is a strict version suitable for CPAN indexing.
Synopsis#
version::is_strict($str);
is_strict($str); # after use version qw(is_strict)
Strict versions rule out alpha underscores and unusual shapes. A decimal version is an integer without leading zeros, optionally followed by one dot and a digit run; a dotted-integer version must start with v and have at least three components. This is the form PAUSE expects for permanent releases.
What you get back#
A boolean: 1 if the string matches the strict grammar, the empty string otherwise.
Examples#
version::is_strict("1.02"); # 1
version::is_strict("v1.2.3"); # 1
version::is_strict("1.2.3"); # "" - needs the v prefix
version::is_strict("1.02_03"); # "" - underscores disallowed
version::is_strict("v1.2"); # "" - needs 3+ components
Differences from upstream#
Fully compatible with upstream version 0.9934.
See also#
is_lax- the permissive counterpartdeclare- the recommended way to produce a strict dotted-integer