chomp() shouldn't really remove the whole word, even a weird setting of $/ wouldn't make that happen.
You can try to use chop(), which trims ONLY the last character no matter what it is but, really, a look at the code would be a better choice: it's probably not chomp that eats your words. ;-)
Michele.