in reply to sorting numerically and alphabetically

For your limited example, sort already does exactly what you want. I guess though that what you want isn't what sort does for the following example:

firstcase_1 secondcase_4 secondcase_11 secondcase_012

What you want is called "natural sorting", and tye has a nice node on it - our categorized Questions and Answers also has How do I do a natural sort on an array?.