in reply to Get a DH from <STDIN>?

so what do I do,

When your program fails to open a directory handle, wait for it :), do NOT try to read from it, because the opendir call failed :)