belize has asked for the wisdom of the Perl Monks concerning the following question:

How is the ownership of a directory created with the "mkdir" function determined on a shared server? Sometimes it goes to "root" and other times to the user. Is it a configuration within the server and has nothing to do with Perl or can it be set within a Perl program?