Splatt has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Check if a directory exists? (boo)
by boo_radley (Parson) on Nov 05, 2001 at 21:55 UTC
    yes. I believe that -d is the test you want.
Re: Check if a directory exists?
by Fastolfe (Vicar) on Nov 05, 2001 at 21:54 UTC
    Please review the basic documentation that accompanies Perl. Notably, the perlfunc document explains what the _X function does. One of its forms tests to see if something is a directory, which should be what you need.

    I also highly recommend the introductory book Learning Perl.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Check if a directory exists?
by msemich (Novice) on Nov 05, 2001 at 23:25 UTC
    Pretty much you should just look at a directory as any other file....its contents just happen to point to another i-node in the system. As such, you can use all of the general file existential operators on a directory or file interchangeably. -d -r -x and all the rest.