in reply to flushing by default

Do you have $file defined anywhere else? Perhaps where you did the print was out of the scope where you opened it, and in the scope of another open?

Did you check to see if "stuff" was in any of the other six files you had open?