I am trying to make a directory in the following code:
# reads in files from a corpus for my $corpusFile (glob("./Corpus/*.txt")) { # makes part of the name of the file the name for a directory my $file = substr ($corpusFile, 9, 6); my $outputFiles = "./Output/$file"; mkdir $outputFiles unless -e $outputFiles or die "Cannot make file directory: $!"; However, I get the error: Cannot make file directory: No such file or directory at perl/corpus.pl
I don't really understand this error. Of course the directory doesn't exist - I'm trying to create it.
To explain my file structure a bit: I have a big folder that contains an "output" folder and a "perl" folder - my perl code is in the folder called "perl" and I'm trying to create a directory in "output." I am very new to perl, so I apologize if the answer here is obvious.
Outputexist? mkdir won't recursively create a structure for you.