Good point about the initial value -- I forgot about that.
It can be specially handled decently, though, something like:
my @new = my $p = shift @orig; push @new, grep { $p = $_ or 1 if $p ne $_ } @orig;
In reply to Re^4: reduce like iterators
by Anonymous Monk
in thread reduce like iterators
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |