Member Rara Avis
I don't see anything wrong with the code itself, Chris.
The output, however, includes a newline that the code above didn't print (\n after $pwd is printed). That suggests that either your chomp isn't being executed or your data file is double-spaced.
Unless you have a really huge database, I would send the header() at the top of the code, then do a print $line through each iteration of the loop. Another thing to try is a regex instead of the chomp; i.e. $line =~ s/\n/!/g; will transform all newlines into bangs so you can see them. Or examine the data in a hex editor?
Without seeing your data, that's about the best I can figure.