Mold needs moisture to grow. Take away the moisture, take away the future mold. Dri-Z-air is about $10 for the starter kit, and about $1 each pack at Home Depot (you WILL pay more at Wal-Mart for it), or just buy the starter kit and some regular (non-salt) side walk de-icer, it is the same stuff and a lot cheaper.
To kill already present moisture, water with a little bit of elbow grease and bleach should work. In carpet, you will probably have to tear it out and replace it as the padding underneath holds onto moisture quite well...