is_strict#
Test whether a string is a strict version suitable for CPAN indexing.
תקציר#
version::is_strict($str);
version->is_strict($str);
Strict versions rule out alpha underscores and unusual shapes. A decimal version must be a single dot between two digit runs; a dotted-integer version must start with v and have at least three components. This is the form PAUSE expects for permanent releases.
מה מוחזר#
A boolean: 1 if the string matches the strict grammar, the empty string otherwise.
דוגמאות#
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
הבדלים מן ה-upstream#
Fully compatible with upstream version 0.9929.
ראו גם#
is_lax- the permissive counterpartdeclare- the recommended way to produce a strict dotted-integer