in reply to Help Me!

print "ID: $_\n"; shouldn't be in the inner loop, better do

print "ID: $word[0]\n"; ...

outside.

Cheers Rolf