Very bad idea to use moth balls anywhere near veggies, moth balls are poisonous & will contaminate the soil.I put moth balls around my garden and flowers and it seems to work.
Moth balls are fine for ornamental gardens only. If they are the naphthalene ones they will also deter snakes.