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


in reply to (Guildenstern) RE: RE (tilly) 1: Creating a file with Open
in thread Creating a file with Open

I'm confused here. Everyone else has been saying "+>$user_name" which makes sense to me. Is your suggestion a typo, or am I missing something fundamental here?
No, not a typo. If you open something with +>, you are saying "zero out this file" before anything else happens. At that point, if someone else has the flock already, you are now erasing their work. You must open in a way that preserves any existing data, but if you're also going to write to it, you must use two-way mode, like +< or +>>.

-- Randal L. Schwartz, Perl hacker