Update: I misread the question.

thundergnat's pattern doesn't work for me with my 5.6.1, it puts every character into an element.

I had: push @ans, $1 while $str =~ /(.{3}|.{1,2}$)/g;

Be well,
rir


In reply to Re^2: Puzzlement in Splitsville by rir
in thread Puzzlement in Splitsville by tlm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":