chdir("test") ## For eg:test can be directory where the files exist. unless (-d "BSD"){ mkdir("BSD") or warn ("unable to create directory BSD"); } unless (-d "SBSCSubsystem"){ mkdir("SBSCSubsystem") or warn ("unable to create directory SBSCSubsystem"); } unless (-d "MCBTSSubsytem"){ mkdir("MCBTSSubsytem") or warn ("unable to create directory MCBTSSubsytem"); }