Help for this page

Select Code to Download


  1. or download this
    my $n = 5;
    
    my @data = (1, 30, 4, 5, 12, -12, 4.1, 18,20, 2, 0 ,4, 36, 0, 8, 15, 4
    +2, 4711, 0xdead, 0xbeef);
    ...
    my @top5= (sort { $b <=> $a } @data)[0..$n-1];
    
    print join "\n",@top5,'';