you would most likely have to take a stool sample to the vet, and your cham would be treated with a de-wormer. Something like Panacur, I would think. Our vet said it is a broad spectrum antiparasitic.
If the little squirmy thing was kept, if it is a tape worm...when they dry out, they have a very distinctive appearance. They will look like a tiny grain of light brown rice. At least that's what mammal tape worms look like when they dry out, I would assume it would be the same for a reptilian tape worm.