in reply to Re^9: First foray into Perl
in thread First foray into Perl
A minor update: This version of the loop may be a bit nicer (tested):
# works -- a while loop might be more efficient/elegant MAX_BASES: while (@base_values) { # @base_values is consumed $max_bases .= $_->[1] for # append base of each max reduce { $a->[0] > $b->[0] ? $a : $b } # max in group map [ shift(@base_values), $_ ], @base_ord # groups of n ; }
|
|---|