I'm surprised it doesn't work (assuming, of course that /mydir indeed exists). Is this a Unix system?
Incidentally, I would use the -d test in this case, which implies -e, and returns true only if the tested file not only exists, but is actually a directory. For example (OS: Linux):
% perl -wle '$x=q(/boot); print "OK" if -d $x' OK
the lowliest monk
In reply to Re: directory exists
by tlm
in thread directory exists
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |