Use perror for error reporting.