<?xml version="1.0" encoding="windows-1252"?>
<node id="632057" title="Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)" created="2007-08-12 10:24:36" updated="2007-08-12 06:24:36">
<type id="11">
note</type>
<author id="44715">
graff</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;em&gt;
If you don't mind the different order of the output...
&lt;/em&gt;&lt;/blockquote&gt;
&lt;P&gt;
... and also don't mind the possible loss of some intended output:
&lt;c&gt;
# OP's solution, given a different input:

$ perl -le'print $1 while "ZBBBCZZCZ" =~ /((.)\2*)/g'
Z
BBB
C
ZZ
C
Z

# jwkrahn's solution for that input:

$ perl -le'print for keys %{{"ZBBBCZZCZ" =~ /((.)\2*)/g}}'
Z
ZZ
BBB
C

&lt;/c&gt;
(Not to mention that the OP approach wins at golfing. :)</field>
<field name="root_node">
632023</field>
<field name="parent_node">
632035</field>
</data>
</node>
