in reply to if (-d$_) failes because of white space
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()) +; } }
|
|---|