Help for this page

Select Code to Download


  1. or download this
    (my $max, @vals) = reverse sort @vals;
    # or sort {$b cmp $a} @vals
    # in any case, the one to assign to the scalar has to come first
    
  2. or download this
    my $max = pop(@vals = sort(@vals));
    
  3. or download this
    use List::Util 'maxstr';
    my $max = maxstr(@vals);