Ick, no doubt about! But you should know soon enough. They could be the same parasite species - ascaris. It is my understanding, when looking into this, the "sacs" only comes with fertilization by the male -- parasite sex party! The females don't need the males to lay eggs, they will lay the regardless if one is around or not.
The pearls inside the sacs were fairly large. BTW, the next time you cough them up, are you able to take a picture and post it?