using `perror` for errors