You are viewing the version of this documentation from Perl 5.005_04. View the latest version
mkdir FILENAME,MODE

Creates the directory specified by FILENAME, with permissions specified by MODE (as modified by umask). If it succeeds it returns TRUE, otherwise it returns FALSE and sets $! (errno).

In general, it is better to create directories with permissive MODEs, and let the user modify that with their umask, than it is to supply a restrictive MODE 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). The perlfunc(1) entry on umask discusses the choice of MODE in more detail.