Help for this page
my $modified = reduce{ my( $x1, $y1, $x2, $y2 ) = ( @{ @{ $a }[ -1 ] }, @$b ); $x2 < $x1 ? pop @{ $a } : push @{ $a }, $b; $a; } [ shift @points ], @points;
my $i = 1; while ($i < @points) { ... $i++; } }
my $modified = []; for my $point (@points) { ... push @$modified, $point; } }
my @m; @m&&$m[-1][0]>$_->[0]?pop @m:push @m,$_ for @points;