Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

News / Blogs

- Perl Buzz
- Perl Iron Man
- Perlsphere
- Planet Perl
- TPF news
- Use Perl

See also

- CPAN
- Perl.org
- Perl.com
- Perl 5 Wiki
- Perl Jobs
- Perl Mongers
- Perl Monks

Contact

- Site designed and maintained by Jon Allen (JJ)
- http://perl.jonallen.info

- View the project page and FAQs

# DirHandle

Perl 5 version 10.1 documentation
Go to top • Show page index • Download PDF

# DirHandle

- NAME
- SYNOPSIS
- DESCRIPTION
- NOTES

# NAME

DirHandle - supply object methods for directory handles

# SYNOPSIS

        use DirHandle;    $d = DirHandle->new(".");    if (defined $d) {        while (defined($_ = $d->read)) { something($_); }        $d->rewind;        while (defined($_ = $d->read)) { something_else($_); }        undef $d;    }

# DESCRIPTION

The `DirHandle` method provide an alternative interface to the opendir(), closedir(), readdir(), and rewinddir() functions.

The only objective benefit to using `DirHandle` is that it avoids namespace pollution by creating globs to hold directory handles.

# NOTES

- On Mac OS (Classic), the path separator is ':', not '/', and the current directory is denoted as ':', not '.'. You should be careful about specifying relative pathnames. While a full path always begins with a volume name, a relative pathname should always begin with a ':'. If specifying a volume name only, a trailing ':' is required.

Page index

- NAME
- SYNOPSIS
- DESCRIPTION
- NOTES

Recently read

Tools

- Preferences