in reply to greping for names

You should use a regular expression like this:

while (<>) { print if /\.c$/; }