in reply to if ( -d ) question
Because "$_" and "$mydir/$_" are two different things?
It's unclear to me what different outcome you expect. Should -d "foo" be true if anywhere on the filesystem there exists a directory with a name of "foo"?