in reply to sorting numbered words

Sort::Naturally will do this:

(Updated to show that it will also work fine with something like "text69.something-14-14")

(Update 2: Sort::Naturally also handles the data used by BrowserUK below "correctly") :)

#!/usr/bin/perl -w use strict; use Sort::Naturally; print for nsort(<DATA>); __DATA__ text1 text69.something-14-14 text2 text37 text5 text3 text10 text11

Gives:

text1 text2 text3 text5 text10 text11 text37 text69.something-14-14

Cheers,
Darren :)

Replies are listed 'Best First'.
Re^2: sorting numbered words
by salva (Canon) on Dec 18, 2006 at 18:24 UTC