programming-examples/perl/Array/Character and Number Sorts.pl
2019-11-15 12:59:38 +01:00

13 lines
277 B
Raku

@names = (Tom, Tom, James, Pete, Cindy, Carol);
@names = sort @names;
print "@names\n";
@numbers = (12,45,36,14,258,1,2,4,);
@numbers = sort @numbers;
print "@numbers\n";
@numbers = sort sortNumbers @numbers;
print "@numbers\n";
sub sortNumbers(){
$a <=> $b;
}