Should this be `puts`?  Also, since there is the `unless` qualifier at the end, use parenthesis for clarity... `outfile.print(line) unless...`