bool#

Give a version object its boolean truth value — true unless every component is zero.

Synopsis#

if ($v) { ... }

This backs the overloaded bool operator. A version is false only when it has no non-zero component, i.e. it compares equal to v0.0.0. Every other version is true, including v0.0.1.

What you get back#

A boolean: 1 for any non-zero version, the empty string for v0 / 0.000 / v0.0.0.

Examples#

version->new("0")->boolean;          # ""
version->declare("v0.0.0")->boolean; # ""
version->new("0.001")->boolean;      # 1
version->declare("v0.0.1")->boolean; # 1

Differences from upstream#

Fully compatible with upstream version 0.9929.

See also#

  • vcmp — the three-way comparison behind the ordering operators