NAME

Dpkg::Version - pure-Perl dpkg-style version comparison

DESCRIPTION

The Dpkg::Version module provides pure-Perl routines to compare dpkg-style version numbers, as used in Debian packages. If you have the libapt-pkg Perl bindings available (Debian package libapt-pkg-perl), they may offer better performance.

METHODS

vercmp

Compare the two arguments as dpkg-style version numbers. Returns -1 if the first argument represents a lower version number than the second, 1 if the first argument represents a higher version number than the second, and 0 if the two arguments represent equal version numbers.

compare_versions

Emulates dpkg --compare-versions. Takes two versions as arguments one and three and one operator as argument two. Supports the following operators: 'gt', 'ge', 'eq', 'le', 'lt', and '>>', '>=', '=', '<=', '<<'. Returns a true value if the specified condition is true, a false value otherwise.

check_version($version)

Check the version string and fails it it's invalid.

AUTHOR

Don Armstrong <don@donarmstrong.com> and Colin Watson <cjwatson@debian.org>, based on the implementation in dpkg/lib/vercmp.c by Ian Jackson and others.