Show quoted text>How many people even think about what the mask for mkdir is?
Surely not many; everyone just puts in 0777 because that's the
odd-looking boilerplate you learn to use.
I believe that the best practice is normally to use the 0777
permissions. As perlfaq puts it,
Show quoted text>In general, it is better to create directories with permissive
>MASK, and let the user modify that with their "umask", than it
>is to supply a restrictive MASK and give the user no way to be
>more permissive. The exceptions to this rule are when the file
>or directory should be kept private (mail files, for instance).
So, if it's usually what you want, and perl has even made it the default
choice, it's probably clearer to use that default choice.
I take your point that it would be nice if everyone carefully thought
about what permissions they want when creating files or directories.
However I don't think that is achieved by the current situation where
there is just a weird incantation 0777 that, without much thought, tends
to attach itself to mkdir calls. Note that creating a file with
open($fh, '>', $filename) will also default to the permissions given by
your umask, and that's not considered bad.