in reply to Sorting an array containing version numbers

What have you tried? What makes you think you need heavy optimization? Have you done benchmarking? This sounds like premature optimization to me.

Using the native Perl sort function with a customized comparison function should do what you need, assuming Perl is fast enough for your needs. sort explains the basics, and combining a split with /\./ and piecewise comparison of the resulting arrays with the numeric comparison operator <=> will handle the rest. If this is not fast enough, you can write it all in C and use XS (perlxs, perlxstut).