use IO::Handle; open(FIL,">>$myfil") || "Can't open $myfil: $! \n"; FIL->autoflush();