#!/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";