Forgot to print to a file handle instead of the file reference.