See the current Perl documentation for closedir.

Here is our local, out-dated (pre-5.6) version:

closedir - close directory handle

closedir DIRHANDLE

Closes a directory opened by opendir() and returns the success of that system call.

DIRHANDLE may be an expression whose value can be used as an indirect dirhandle, usually the real dirhandle name.