=over

=item mkdir FILENAME,MODE
X<mkdir> X<md> X<directory, create>

=item mkdir FILENAME

=item mkdir

Creates the directory specified by FILENAME, with permissions
specified by MODE (as modified by L<C<umask>|/umask EXPR>).  If it
succeeds it returns true; otherwise it returns false and sets
L<C<$!>|perlvar/$!> (errno).
MODE defaults to 0777 if omitted, and FILENAME defaults
to L<C<$_>|perlvar/$_> if omitted.

In general, it is better to create directories with a permissive MODE
and let the user modify that with their L<C<umask>|/umask EXPR> 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 documentation for
L<C<umask>|/umask EXPR> discusses the choice of MODE in more detail.

Note that according to the POSIX 1003.1-1996 the FILENAME may have any
number of trailing slashes.  Some operating and filesystems do not get
this right, so Perl automatically removes all trailing slashes to keep
everyone happy.

To recursively create a directory structure, look at
the L<C<make_path>|File::Path/make_path( $dir1, $dir2, .... )> function
of the L<File::Path> module.

=back