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 ; }
In reply to Re^10: First foray into Perl
by AnomalousMonk
in thread First foray into Perl
by LostWeekender
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |