Anemic during pregnancy

So my doctor told me I was anemic yesterday at my appointment and she prescribed me some iron pills, but I heard those get you constipated. Is there a way to avoid constipation?:(