use File::Path; mkpath("/var/tmp/log/script/",0,1777); #### [thom@marvin] $ ls -l /var/tmp/log drwxrwxrwt 2 thom thom 4096 Apr 17 14:25 script #### [thom@marvin] $ ls -l /var/tmp/log d-wx-----T 2 thom thom 4096 Apr 17 14:25 script