in reply to Comparing Version Numbers

First, you need to extract the version number, so that you can compare it. I wrote a utility to comb a directory for duplicates of the same package, keeping only the newest. I used this to get the version number:
# Set $file to the rpm you're querying, then: my @result = `rpm -qp --queryformat "%{NAME}/%{ARCH}/%{VERSION}.%{RELE +ASE}\n" $file`; my ($name, $arch, $version) = split /\//, $result[0];
From there it's straight into a hash with "$name:$arch" as the key, and the version number as the value.

To compare version numbers, split on /\./ and check each array entry separately from left to right.

There are probably nicer ways to do this with a CPAN module, but in this case I was too close to a solution with executing rpm to back up and do the right thing.
--
Spring: Forces, Coiled Again!