Perennial roots will often grow again so it's better not to put these on your compost heap, also any weeds that have already set seeds. As SG6 says, the green bits are ok.
By perennial roots I mean things like dandelions, ground elder, bindweed, etc. I think if the compost heap gets up to the right temperature it may cause the roots to die but I never risk it. I've got enough dandelions and bindweed without spreading it around in the compost. All of mine go in the recycling bin - I believe all that stuff is heat treated before being turned to compost. From what I've read if you chop a dandelion root in to bits it just causes more plants to grow, one from each bit of root...