in reply to Directory checking on Windows XP

If what you say is true, you have a very broken Perl.
>md dir >copy nul file 1 file(s) copied. >perl -le"if (-d $ARGV[0]) { print 'dir' } else { print 'not' }" dir dir >perl -le"if (-d $ARGV[0]) { print 'dir' } else { print 'not' }" file not

I could see the opposite (always getting the else part) due to being in a different working directory than you think you are, having trailing whitespace in your file name or attempting to use wide file names.

Update: Oops, I read it backwards. You are getting the else part.

Replies are listed 'Best First'.
Re^2: Directory checking on Windows XP
by ack (Deacon) on Sep 22, 2008 at 05:43 UTC

    Thanks ikegami. I posted an update to my node and included an abbreviated portion of the code that I think demonstrates what I'm doing. It is not the full code; but think it highlights what and how I'm doing the if(){}else{} statement. Hopefully it will prompt someone to see what is happening.

    I have tried debugging the code; but it just shows that the }else{ portion of the code is, indeed, what is being executed. I have checked what is in $entry and it has the right subdirectory name (includindg the full path specification).

    Is specifing the full path name in $entry what is fowling up the -d file test?

    ack Albuquerque, NM

      Is specifing the full path name in $entry what is fowling up the -d file test?

      No, that's fine. Absolute and relative paths are accepted.

      In fact, nothing is fowled up. Your code works fine.

      bar is a directory foo is a directory sub folder is a directory

      Are you sure "ACK_Kenya_2008" and this directory are really folders and not shortcuts?