Created
March 13, 2017 06:58
-
-
Save tateisu/91283efbdaf1fbddd557a62780554ed8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@list = sort { | |
my $i; | |
$i= $a->a cmp $b->a; $i and return $i; | |
$i= $a->b cmp $b->b; $i and return $i; | |
$i= $a->c cmp $b->c; $i and return $i; | |
return 0; | |
} @list; | |
sort { ($a->a cmp $b->a) || ($a->b cmp $b->b) || ($a->c cmp $b->c) } @list
sort { $a->a cmp $b->a or $a->b cmp $b->b or $a->c cmp $b->c} @list
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sort {
my $i= $a->a cmp $b->a;
$i or $i= $a->b cmp $b->b;
$i or $i= $a->c cmp $b->c;
return $i;
} @list;