Change your code to die() if not a dir and tell you what it tested for.
use Cwd; foreach(@dir) { if (-d$_) { print $_," is a directory.\n"; } else { die("Not a dir '$_', current working directory is: ". cwd()) +; } }
In reply to Re: if (-d$_) failes because of white space
by leocharre
in thread if (-d$_) failes because of white space
by Gretter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |