{
    "content": [
        {
            "type": "text",
            "text": "# DirHandle (man)\n\n## NAME\n\nDirHandle - (obsolete) supply object methods for directory handles\n\n## SYNOPSIS\n\n# recommended approach since Perl 5.6: do not use DirHandle\nif (opendir my $d, '.') {\nwhile (readdir $d) { something($); }\nrewind $d;\nwhile (readdir $d) { somethingelse($); }\n}\n# how you would use this module if you were going to\nuse DirHandle;\nif (my $d = DirHandle->new(\".\")) {\nwhile (defined($ = $d->read)) { something($); }\n$d->rewind;\nwhile (defined($ = $d->read)) { somethingelse($); }\n}\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "DirHandle",
        "section": "",
        "mode": "man",
        "summary": "DirHandle - (obsolete) supply object methods for directory handles",
        "synopsis": "# recommended approach since Perl 5.6: do not use DirHandle\nif (opendir my $d, '.') {\nwhile (readdir $d) { something($); }\nrewind $d;\nwhile (readdir $d) { somethingelse($); }\n}\n# how you would use this module if you were going to\nuse DirHandle;\nif (my $d = DirHandle->new(\".\")) {\nwhile (defined($ = $d->read)) { something($); }\n$d->rewind;\nwhile (defined($ = $d->read)) { somethingelse($); }\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 1,
                "subsections": [
                    {
                        "name": "There is no reason to use this module nowadays.",
                        "lines": 11
                    }
                ]
            }
        ],
        "sections": {
            "NAME": {
                "content": "DirHandle - (obsolete) supply object methods for directory handles\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "# recommended approach since Perl 5.6: do not use DirHandle\nif (opendir my $d, '.') {\nwhile (readdir $d) { something($); }\nrewind $d;\nwhile (readdir $d) { somethingelse($); }\n}\n\n# how you would use this module if you were going to\nuse DirHandle;\nif (my $d = DirHandle->new(\".\")) {\nwhile (defined($ = $d->read)) { something($); }\n$d->rewind;\nwhile (defined($ = $d->read)) { somethingelse($); }\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "",
                "subsections": [
                    {
                        "name": "There is no reason to use this module nowadays.",
                        "content": "The \"DirHandle\" method provide an alternative interface to the opendir(), closedir(),\nreaddir(), and rewinddir() functions.\n\nUp to Perl 5.5, opendir() could not autovivify a directory handle from \"undef\", so using a\nlexical handle required using a function from Symbol to create an anonymous glob, which took\na separate step.  \"DirHandle\" encapsulates this, which allowed cleaner code than opendir().\nSince Perl 5.6, opendir() alone has been all you need for lexical handles.\n\n\n\nperl v5.34.0                                 2025-07-25                             DirHandle(3perl)"
                    }
                ]
            }
        }
    }
}