1N/ADirHandle - supply object methods for directory handles 1N/A $d = new DirHandle "."; 1N/A while (defined($_ = $d->read)) { something($_); } 1N/A while (defined($_ = $d->read)) { something_else($_); } 1N/AThe C<DirHandle> method provide an alternative interface to the 1N/Aopendir(), closedir(), readdir(), and rewinddir() functions. 1N/AThe only objective benefit to using C<DirHandle> is that it avoids 1N/Anamespace pollution by creating globs to hold directory handles. 1N/AOn Mac OS (Classic), the path separator is ':', not '/', and the 1N/Acurrent directory is denoted as ':', not '.'. You should be careful 1N/Aabout specifying relative pathnames. While a full path always begins 1N/Awith a volume name, a relative pathname should always begin with a 1N/A':'. If specifying a volume name only, a trailing ':' is required. 1N/A @_ >=
1 && @_ <=
2 or croak 'usage: new DirHandle [DIRNAME]';
1N/A @_ ==
2 or croak 'usage: $dh->open(DIRNAME)';
1N/A @_ ==
1 or croak 'usage: $dh->close()';
1N/A @_ ==
1 or croak 'usage: $dh->read()';
1N/A @_ ==
1 or croak 'usage: $dh->rewind()';