Help for this page
my @minima; my @maxima; ... push @minima, $array[-1] if $prev_cmp >= 0; push @maxima, $array[-1] if $prev_cmp <= 0; }