Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 2. Idiomatic Perl > Item 22. Learn the myriad ways of sorting

Item 22. Learn the myriad ways of sorting

At its most basic, sorting in Perl is simplicity itself. Perl’s sort operator takes a list of elements and returns a copy of that list in order:

my @elements = sort qw(
  hydrogen
  helium
  lithium
);


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial