parsites can not be selectively treated in such manners. Garlic very well may kill some but only deter others. The rectum is not even part of the colon technically, which is where pin worms, if thats actually where they are, reside for the most part. Pin worms can be found anywhere however, including the appendix which is several feet away from garlic hanging out in the rectal vault. Prolonged contact with the mucus membrane of the rectum could also cause marked irritation, inflammation and discomfort.
Diet does very little to cure an existing infestation, many experts both medical and natural will agree. While slurping high fructose corn syrup through a straw may be cause for their celebration, abstaining from it will not cure you. Worms can not be "starved" out. I assure you they will outlast any of us hands down. In fact poor nutrition can exacerbate an existing infestation. They WILL eat, with or without your help. The only protection we have from them is lifestyle, which includes prevention, good nutrition such that their presence becomes less of a burden, healthy intact immune system (nothing compares) and anthelmenthic therapy when carried out correctly.