open(file, ">$filename") flock file, 2; print file "Whatever you want to say"; close(file);