I hit comment, and bam, nothing left for me to write :)
Well, flush Returns "0 but true" on success, "undef" on error., so you ought to capture the return value of print...
MJDsays "you can't just make shit up and expect the computer to know what you mean, retardo!"