$regexp="a{2}"; $_="aaaa"; push @a , $1 while m/(?=($regexp))./g; print join ( "-", @a ) . "\n";