http://www.perlmonks.org?node_id=512779


in reply to Elegant way to split into sequences of identical chars?

You may want to take a look at the node: Puzzlement in Splitsville which discusses this exact issue. Lots of answers there.

  • Comment on Re: Elegant way to split into sequences of identical chars?

Replies are listed 'Best First'.
Re^2: Elegant way to split into sequences of identical chars?
by japhy (Canon) on Nov 29, 2005 at 21:50 UTC
    ... perhaps the best of which is Anonymous Monk's "In Perl6, this can be done using a single, 5 Unicode-character long, operator."

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

      Notice I didn't say lot's of GOOD answers there...

      Instead, there's the whole gamut of answers. A couple examples of good idiomatic perl, a few obscure hackish answers, one of C written in perl and at least one of someone who seriously shouldn't have skipped his meds that morning.