RosettaCodeData/Task/Sort-an-array-of-composite-structures/Perl/sort-an-array-of-composite-structures-2.pl
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

2 lines
100 B
Perl

@people = (['joe', 120], ['foo', 31], ['bar', 51]);
@people = sort { $a->[1] <=> $b->[1] } @people;