I guess which does not return an error code. If it does not find anything, the return is just blank. If it finds something, the path is returned. So the change of code did not help, because there is just no error message. Could there be a $path problem in the subprocess started inside the binary?