Skip to content

Instantly share code, notes, and snippets.

@juster
Created June 13, 2010 23:41
Show Gist options
  • Save juster/437097 to your computer and use it in GitHub Desktop.
Save juster/437097 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# Requires my ALPM perl module, which will probably break when pacman
# 3.4.0 comes out... unless I have time to hack on ALPM before then.
use warnings;
use strict;
use 5.010;
use ALPM;
*vercmp = *ALPM::Package::vercmp;
my @vers = qw/ 1.9.0 1.10.0 1.11.0 2.0.0 /;
my $last = shift @vers;
while ( defined ( my $next = shift @vers )) {
my $is = ( vercmp( $last, $next ) < 0 ? q{is} : q{is not} );
say "$last $is less than $next";
$last = $next;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment