Perl Language Sorting

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Introduction

For sorting lists of things, Perl has only a single function, unsurprisingly called sort. It is flexible enough to sort all kinds of items: numbers, strings in any number of encodings, nested data structures or objects. However, due to its flexibility, there are quite a few tricks and idioms to be learned for its use.

Syntax

  • sort SUBNAME LIST
  • sort BLOCK LIST
  • sort LIST


Got any Perl Language Question?