Using umask in perl The easiest way to use umask in perl is with octal notation umask 077; # open newfile with permissions rw- --- --- open PRIVATE, ">newfile" or die; # create new directory with permissions rwx --- --- mkdir "newdir" or die; # mkdir is modified by umask, so this will create # the dir with at most 0700 perms. mkdir "newdir2", 0700 or die;