in reply to Testing for a directory handle

I was going to point you into B::IO direction, but it seems that information is not exposed there either.

You could write a little XS module to look into the xpvio structure. I think the dirp slot is the one telling you it is an open directory handle.