Is it a known behavior that if you 'open' a file for writing that does not already exist, umask settings are properly applied, yet if a file that exists is opened for (over)writing, it keeps the existing permissions, ignoring the umask settings?
This drove me nuts for an hour this morning on a Linux box with Perl 5.16.