in reply to Sorting array
Hi negativ_m,
This is a frequently asked question, see for example the recent thread Sorting text-number values for some solutions as well as links to other places like How do I do a natural sort on an array? that give even more possible solutions. One possible module to help you is Sort::Key.
Update: I just realized your sorting rules appear to be unclear: text1g.txt comes after text2.txt but before text54f.txt?
Update 2: As Eily noted, it does seem like you might want to filter the array instead of or in addition to sorting it. Please see How do I post a question effectively?, at the very least you'd have to describe the algorithm for selection of the "latest version" as well as give enough test cases so we don't have to guess.
Hope this helps,
-- Hauke D
|
|---|