in reply to Re: PLEADE HELP ME!![NEWBIE]
in thread PLEADE HELP ME!![NEWBIE]

$seq .= ', '; my $rep = 1; $rep++ while $seq =~ s/(.+?)\K\1//;
doesn't work for 11, 2, 11, 2

Replies are listed 'Best First'.
Re^3: PLEADE HELP ME!![NEWBIE]
by Eliya (Vicar) on Dec 20, 2011 at 23:05 UTC

    Thanks.  It can be fixed by being more specific in the match:

    $rep++ while $seq =~ s/^((?:[^,]+, )+?)\K\1//;