Use a safer open() instead of backticks