http://www.perlmonks.org?node_id=463064


in reply to directory exists

What is your expected behavior? It seems to work for me, though I would make the condition:
... if (-e $mydir && -d _){ ...
to explicitly test that the file is a directory.



Code is (almost) always untested.
http://www.justicepoetic.net/