in reply to inplace edit

I'm guessing the problem is the $1 in your xargs command. xargs will automatically put the contents of the file as the arguments for you. You don't need the $1 which likely contains the offending '.'.

Try this instead:

find . -name '*.c' -exec perl -pi.bak -e 's/name1/name2' {} \;
If you wanted it all in perl, you could use the File::Find module after a simple find2perl.