S
Suzanne
I am new to Perl but I did a lot of web searching and haven't found an
answer to my problem.
I have to compare strings that are version numbers. I want to know if
a version number is less than or equal to another version number.
For example, version 3.2 is less than version 3.16. But when I
compare them, 3.16 is considered less. I tried the cmp function and
got the same results.
I could strip the contents after the '.' and compare them numerically
but it becomes difficult if the version number is 3.2.1.5 (for
example).
Any ideas? Thanks in advance.
answer to my problem.
I have to compare strings that are version numbers. I want to know if
a version number is less than or equal to another version number.
For example, version 3.2 is less than version 3.16. But when I
compare them, 3.16 is considered less. I tried the cmp function and
got the same results.
I could strip the contents after the '.' and compare them numerically
but it becomes difficult if the version number is 3.2.1.5 (for
example).
Any ideas? Thanks in advance.