use Sort::Key::Natural qw(natsort); @sorted = natsort qw(foo12a foo12z foo13a foo 14 9x foo12 fooa foolio Foolio Foo12a);