A fish can be rid of any living worms by either being frozen for 24 to 72 hours at a temperature of minus 4 degrees Fahrenheit or by being cooked at a temperature of 140 degrees Fahrenheit for at least 10 minutes. There is a good chance that you ate a sandwich made with a cod fillet that contained worm larvae that had been killed by freezing, cooking, or a combination of the two.