$|=1; # $| is undef by default - which means use buffering - define it as 1 - and it instantly writes. print FILE scalar localtime; print FILE " ## Exit\n"; close FILE; #### $close = localtime; print FILE "$close ## Exit\n"; close FILE;