in reply to reduce like iterators
It's much simpler than the "semipredicate problem" because all you have to do is set the previous value to "not the first value".
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=880228 use warnings; sub squeeze { no warnings; my $prev = not $_[0]; return grep +($_ ne $prev, $prev = $_)[0], @_; }
|
|---|