in reply to Sorting complex data
To clarify the above ... the sort verb allows a comparison subroutine to be specified. That can be as simple as the “one-liner” in-between (and including) the curly braces, which uses the <=> operator designed expressly for this purpose, or it can be a much more complicated function. Within that function, for your further convenience, the variables $a and $b are magically defined.
In Section
Seekers of Perl Wisdom