Help for this page

Select Code to Download


  1. or download this
    my @data = qw(1a 1b 2a 2b);
    my @s1 = reverse sort { $a <=> $b } @data;
    my @s2 = sort { $b <=> $a } @data;
    print "@s1\n@s2\n";
    
  2. or download this
    2b 2a 1b 1a
    2a 2b 1a 1b