thanks everyone for the replies. I am really not very experienced in perl, since I do not use it so much.
As for counting the bases between the matches... I'd save the match positions, and the subtrac them to get the actual distances ;)
I can use index to do that, but then I need to add +3 in the first one, and then I want to store them in an array, so in the end I can calculate the avg distance, by dividing the sum of the distances, by the count. any suggestions, how to do that?