Perl has an easy to use “sort” function. For example, you might have an array like this:
Perl Sorting
Arrays often need sorting. Perl has built-in ways to help you, but as usual, there’s more than one way to do it.
To play with the examples shown here, you’ll need a file containing a few lines of words. I’ll use this:
Sorting Techniques
Sorting is a commonly needed operation in all kinds of programs. Luckily, for us perl programmers, perl provides a very simple yet extremely powerful mechanism to accomplish any sort you might think of. This article is about teaching the novice programmer how to sort lists of things, while showing to the more experienced folks certain techniques and ideas that could be new to them if they are migrating from a different language.
Sorting Your Money
For anyone that is familiar with The Complete Budget and Bill Organizer, you already know that I recommend that you use your checking account to pay bills and cash to cover your household expenses.
How to use XPath and sorting in XML
In the first article I have shown you how to get quick results with XML,XSL and ASP. I have also introduced a short paragraph about XPath. In this article i will show you how you can use this combination with a very easy and understandable code to sort data. As sorting is a very important task that needs to be implemented in nearly every form, simplifying its implementation will save you precious developement time in your projects. As opposed to the hand crafted solutions that one needed to use in the past, XPath enables you to write robust, self documented and easy to understand sorting code with a very short developement cycle.