February 2012
Intermediate to advanced
1184 pages
37h 17m
English
use version 0.77;
my $version = version–>parse($version_string);
my $qversion = qv($other_version_string);
if ($version > $qversion) {
say "Version is greater!";
}The version module isn’t really a pragma, but it looks like one since
its name is all lowercase. Before v5.10, version provided a way to quote version with
qv() and compare version numbers. It
sounds simple, but when you get down to the hairy task it actually is, you
might doubt your commitment to programming. For instance, how do you order
the versions 1.02, 1.2, and v1.2.0? Now Perl can do that internally.
It’s still a mess, though.[262]
[262] You might like David Golden’s “Version numbers should be boring”.
Read now
Unlock full access