in reply to reduce like iterators

Compress() is easily defined in terms of a generic adjacent pairing routine:

#! perl -slw use strict; sub adjacentPairs (&@) { my $code = shift; map { local( $a, $b ) = @_[ $_-1, $_ ]; $code->(); } 1 .. @_; } print adjacentPairs{ defined $b && $a eq $b ? () : $a } qw[a a a b c c a a d e e e e]; __END__ C:\test>compress abcade

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.