The correction is that I did of course, also add the opendir(SUBDIR... line as well as the other 3 lines.
I had assumed that each time I called printdir() a new SUBDIR filehandle, scoped to the instance of printdir() that I had just created, would spring forth. I suspect that that assumption is incorrect.