#!/bin/perl
@number=qw/5 10 15 3 2 4 8 6 /;
my @descending =sort {$a=>$b} @number;#这里$a=5,$b=10,因为$a在前,perl得到的结果是小数在前,也就是升序排列
print "@descending\n";
#!/bin/perl
@number=qw/5 10 15 3 2 4 8 6 /;
my @descending =sort {$b=>$a} @number;
print "@descending\n";