in reply to detecting file open failure

Backticks give you the output of the program. That isn't what you want. Instead, you want system. You can retrieve the exit code from $?.