Movatterモバイル変換


[0]ホーム

URL:


DirHandle
(source,CPAN)
version 1.05
You are viewing the version of this documentation from Perl 5.38.3.View the latest version

CONTENTS

#NAME

DirHandle - (obsolete) supply object methods for directory handles

#SYNOPSIS

# recommended approach since Perl 5.6: do not use DirHandleif (opendir my $d, '.') {    while (readdir $d) { something($_); }    rewind $d;    while (readdir $d) { something_else($_); }}# how you would use this module if you were going touse DirHandle;if (my $d = DirHandle->new(".")) {    while (defined($_ = $d->read)) { something($_); }    $d->rewind;    while (defined($_ = $d->read)) { something_else($_); }}

#DESCRIPTION

There is no reason to use this module nowadays.

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

Up to Perl 5.5, opendir() could not autovivify a directory handle fromundef, so using a lexical handle required using a function fromSymbol to create an anonymous glob, which took a separate step.DirHandle encapsulates this, which allowed cleaner code than opendir(). Since Perl 5.6, opendir() alone has been all you need for lexical handles.

Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.

The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.


[8]ページ先頭

©2009-2025 Movatter.jp