in reply to Help regarding an alogrithm

Perl? Overkill.

Something like (untested, may need tweaking) should do:

$ find `cat data.txt` -name '*.c' -print0 | -xargs -0 grep -i modem