my @list= split /(?<=(.))(?!\1)/, "aaabbccccdd eee"; @list= @list[ map 2*$_, 0..@list/2-1 ];