That's ok! It gives me a good picture of it in my mind!
It sounds like you are describing tapeworms. Tapeworms might look like white rice crawling from the anus when they are alive or sesame seeds when they have died.
You need to treat for the parasite. The best way to do it is to give your vet a call and describe the worm to him. They will usually let you swing by and pick up some droncit or drontal plus that will take care of the problem.
SOME over the counter wormers work for tapeworms but not the generic kind. You have to get one that is specifically formulated for tapeworms or it will not work.
You also need to treat any flea problems you have because that's usually where tapeworms start. The dog eats the flea and this is the larvael stage that you are seeing come back out. They can also get it from eating dead rodents, etc.
Let me know if you still have questions!