You shouldn't assume grep is in /usr/bin. On many systems it's in /bin.
Perl's exec and Python's subprocess already search for executables in PATH, so you don't need to provide the full path.
In C, you can use execvp() instead of execv().
(No idea about PHP…)