http://www.perlmonks.org?node_id=665791


in reply to Creating new folders

Can't reproduce the problem under W2k and AS 5.8.8.

perl -v
This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 33 registered patches, see perl -V for more detail)
...
Binary build 819 [267479] provided by ActiveState http://www.ActiveState.com Built Aug 29 2006 12:42:41

OP's path is only 62 chars, at most, so that's not the issue. So, starting with no directory, "test," extant in C:\

C:\>dir t* ... Directory of C:\ 09/04/2006 11:26a <DIR> TEMP 0 File(s) 0 bytes 1 Dir(s) 10,945,437,696 bytes free

Quoting varied from OP's, solely (AFAIK) because the following is run as a one-liner:

C:\>perl -e "if (!-d 'c:/test') {mkdir 'c:/test1';}" C:\>dir t* ... Directory of C:\ 09/04/2006 11:26a <DIR> TEMP 02/02/2008 10:14p <DIR> test1 0 File(s) 0 bytes 2 Dir(s) 10,945,437,696 bytes free

...and, further variance this time in both quoting and slash direction:

C:\>perl -e "if (!-d 'c:/test') {mkdir \"c:/test\";}" C:\>dir t* ... Directory of C:\ 09/04/2006 11:26a <DIR> TEMP 02/02/2008 10:17p <DIR> test 02/02/2008 10:14p <DIR> test1 0 File(s) 0 bytes 3 Dir(s) 10,945,404,928 bytes free

So, are you sure your code is not working? ...sure that E:\ exists and is writable? ... Update - addition ...sure that all the dirs between E:\ and the first you're trying to create actually exist? (See the second bullet in plobsing's reply, above.)