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 counterpart

  • declare - the recommended way to produce a strict dotted-integer