in reply to Reading in of a file
One more note though your real problem is solved. You should consider adopting the three argument open, like so–
More on the topic via Google.