If you have issues with fruit flies, it's certainly best to get rid of them before making your starter if you are using the foil over the opening method that Whitey and others have recommended (this applies less for folks using airlocks or foam stoppers). However, as anyone who has been visited by these pesky buggers knows, they can show up from nowhere, so a handy trick to get the gas exchange and no headspace pressure of using foil, but preventing flies (and all the bacteria and yeast on their feet) from getting in is to do the following:
1. After setting up your starter, wrap foil over the opening and secure it tightly with a rubber band.
2. Using a sanitized pin or needle, gently poke a series of holes in this layer of foil, taking care not to rip it. Essentially, you are making a screen, and I suppose one could use mesh or screen, but foil is cheap and easy, and can be recycled after each use... less sanitization to potentially worry about.
3. Loosely wrap a second piece of foil over the top of the flask. Flies are prevented from dropping into your starter, it's shielded from airborne dust particles, and it allows for gas exchange with the yeast pressure free.






