1DirHandle(3pm) Perl Programmers Reference Guide DirHandle(3pm)
2
3
4
6 DirHandle - supply object methods for directory handles
7
9 use DirHandle;
10 $d = new DirHandle ".";
11 if (defined $d) {
12 while (defined($_ = $d->read)) { something($_); }
13 $d->rewind;
14 while (defined($_ = $d->read)) { something_else($_); }
15 undef $d;
16 }
17
19 The "DirHandle" method provide an alternative interface to the
20 opendir(), closedir(), readdir(), and rewinddir() functions.
21
22 The only objective benefit to using "DirHandle" is that it avoids
23 namespace pollution by creating globs to hold directory handles.
24
26 ยท On Mac OS (Classic), the path separator is ':', not '/', and the
27 current directory is denoted as ':', not '.'. You should be careful
28 about specifying relative pathnames. While a full path always
29 begins with a volume name, a relative pathname should always begin
30 with a ':'. If specifying a volume name only, a trailing ':' is
31 required.
32
33
34
35perl v5.8.8 2001-09-21 DirHandle(3pm)