Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

rmdir

Removes an empty directory.

Deletes the named directory, which must be empty. If no argument is given, uses $_. Returns 1 on success, 0 on failure. On failure, sets $! to the OS error code (e.g. ENOTEMPTY, ENOENT, EACCES).

Only empty directories can be removed; use File::Path::rmtree for recursive deletion.

Synopsis

rmdir("olddir") or die "Cannot rmdir: $!";
rmdir $_;        # uses $_ if no argument

See Also

mkdir, unlink, File::Path