in reply to opening a file using CGI

Have you tried printing the path and checking to make sure it's valid? Keep in mind that opening a file requires the full path, not just the path from your hosting account.

Also, if the file doesn't have the proper permissions, that may be blocking the read. If you're using the full path, and the path matches correctly, check permissions.