while (<>) { if ($theCfile =~ /\.c$/) { print $_ } }