in reply to flushing by default

Most people close() the file after they are done printing to it which flushes the buffer. You can make default autoflush by setting the $| variable (read perldoc perlvar) You can also localize it. Advantages? No idea. Sometimes you have to set it for certain tasks, but usually I don't set it.