I have used a great little module called, Sort::Versions a few times. This module has a sub called versioncmp() that takes two version numbers as arguments, and returns -1, 0, or 1, like the 'cmp' operator, depending on which arg it thinks represents the later version number. It seems to belive that "1_5" is greater than "1.5". This may or may not be what you're looking for.
I strongly encourage you to have a look at the POD for the module... on CPAN under Sort::Versions. There are two versions of the module there, so be sure that you're looking at the later one (ironic isn't it?). The POD discusses the comparison algorithm so that you won't have any surprises.
For a simple real world example of this module in use, have a look at Check websites for software version updates (ex. Garmin), where I use the versioncmp() function to determine whether the Garmin website has posted updates for the firmware for my GPS, or its PC-side software. It works great.
Dave
In reply to Re: General version comparison of CPAN modules
by davido
in thread General version comparison of CPAN modules
by andreas1234567
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |