I've come across an odd issue with -d on a windows box I have a script which recurses through a directory structure down two levels eg: ─Customers Reports └───Customers Reports ─Internal Reports └───Report Project1
For the first one (Customer Reports) where the sub-directory has the same name using -d as a check works fine. However the Last one Internal Reports (which has a different named subdir ) -d fails code my @dirs=glob("*"); foreach my $dir1 (sort @dirs){ chdir $dir.'\\'.$dir1; my @dir2=glob("*"); foreach my $file (@dir2){ if (-d $file){ -- fails on some directory if ($file!~/\....$/){ --alters so it works by excluding dos file ext chdir $dir.'\\'.$dir1.'\\'.$file; my @reps=glob("*rdl"),"\n" } } For info these are all SSRS reports projects so the structure is Subfolder (which contains reports) file same name as parent with .sln ext file same name as parent with .suo ext (sometimes) Any ideas appreciated