use IO::Handle; open my $f, '/tmp' or die $!; $f->sync or die "fsync: $!\n";