- or download this
use List::Util 'max';
my @scores = <FH>;
my $high_score = max(@scores);
- or download this
my $high_score;
while ( <FH> ) {
chomp;
$high_score = $_ if ! defined $high_score || $_ > $high_score;
}
- or download this
sub gen_max {
# Create an initial default value (or undef)
...
# Get the return value of the anonymous sub
my $high_score = $max->();
- or download this
sub gen_reduce {
my $usage = 'Usage: gen_reduce("initial" => $val, "compare" => $co
+de_ref)';
...
$maxstr->($_);
}
my $long_str = $maxstr->();