6 require Config; import Config;
7 if (not $Config{'d_readdir'}) {
17 $dot = new DirHandle ($^O eq 'MacOS' ? ':' : '.');
19 print defined($dot) ? "ok" : "not ok", " 1\n";
22 do { $first = $dot->read } while defined($first) && $first =~ /^\./;
23 print +(grep { $_ eq $first } @a) ? "ok" : "not ok", " 2\n";
25 @b = sort($first, (grep {/^[^.]/} $dot->read));
26 print +(join("\0", @a) eq join("\0", @b)) ? "ok" : "not ok", " 3\n";
29 @c = sort grep {/^[^.]/} $dot->read;
30 print +(join("\0", @b) eq join("\0", @c)) ? "ok" : "not ok", " 4\n";
34 print defined($dot->read) ? "not ok" : "ok", " 5\n";