http://qs1969.pair.com?node_id=11154945


in reply to Is it possible at all to flush buffer and commit file write, if UTF-8 encoding is being used??

my $oldfh = select $logf; $| = 1; select($oldfh); *does* flush Perl's buffer.

$logf->autoflush(1); *does* flush Perl's buffer.

$logf->flush(); *does* flush Perl's buffer.

close $logf; *does* flush Perl's buffer.

It doesn't necessary flush the OS's buffers. (You'll need to ask the OS to do that.) But the data will appear in the file to other processes.