Of course, perror is not enough. One of my favorite error messages happens when a new user sits down to edit a file, and types the name of the file. The shell comes back with file: permission denied which makes them think they don't have access to the file. What really happened is that they forgot to type "vi".