http://qs1969.pair.com?node_id=517197


in reply to Sorting an array on two computed fields

I think you want Sort::Naturally.

But if it's just for this restricted task, then of course you can roll your own code. Well, you can try your hand at the general problem too.

Having asked this very question myself some time ago in clpmisc I'll point you there: search for "sorting strings numerically"; e.g.: Benjamin Goldberg's reply and this thread. Unfortunately I cannot get from Google all the relevant posts in one thread.