XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I have a hash with the keys being the names and versions of available applications:
Given an application name, I need to find the latest available version. For example, given the hash above, if I have "gcc", I want to return "gcc-3.3.2", "make" should return "make-3.79.1", and "cobol" should return false or undef. I can do this by sorting the keys in reverse order and looking for the first match for, for example /^gcc-/, but that seems... inefficient. I know I will need to get get more creative in my sorting (for example, when gcc-10.0 is released), but for now let's assume that cmp gives a correct comparision between versions. Any ideas? tektsu kiku wa ittoki no haji kikanu wa matsudai no haji In reply to Finding the latest available version of a program by tektsu
|
|