Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the same way we used indices to solve a few problems with grep and map back in Chapter 2, we can also use indices with sort to get some interesting results. For example, let's sort the list of names from earlier:
my @sorted = sort qw(Gilligan Skipper Professor Ginger Mary_Ann); print "@sorted\n";