in reply to Re: multiple matches with regexp
in thread multiple matches with regexp

I stripped this for me down to
$regexp="a{2}"; $_="aaaa"; do { push @a, $1 if ( m/^($regexp)/ ) } while ( s/^.// ) ; print join ( "-", @a );
The main difference is, that I match the pattern at the beginning of the string while you match it on the substr

Thanks for the input.