{
    "content": [
        {
            "type": "text",
            "text": "# Net::LDAP::LDIF (info)\n\n## NAME\n\nNet::LDAP::LDIF - LDIF reading and writing\n\n## SYNOPSIS\n\nuse Net::LDAP::LDIF;\n$ldif = Net::LDAP::LDIF->new( \"file.ldif\", \"r\", onerror => 'undef' );\nwhile ( not $ldif->eof ( ) ) {\n$entry = $ldif->readentry ( );\nif ( $ldif->error ( ) ) {\nprint \"Error msg: \", $ldif->error ( ), \"\\n\";\nprint \"Error lines:\\n\", $ldif->errorlines ( ), \"\\n\";\n} else {\n# do stuff\n}\n}\n$ldif->done ( );\n\n## DESCRIPTION\n\nNet::LDAP::LDIF provides a means to convert between Net::LDAP::Entry\nobjects and LDAP entries represented in LDIF format files. Reading and\nwriting are supported and may manipulate single entries or lists of\nentries.\n\n## Sections\n\n- **Net::LDAP::LDIF(3pm)  User Contributed Perl Documentation Net::LDAP::LDIF(3pm)**\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SPECIAL FEATURES**\n- **CONSTRUCTOR**\n- **METHODS**\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::LDAP::LDIF",
        "section": "",
        "mode": "info",
        "summary": "Net::LDAP::LDIF - LDIF reading and writing",
        "synopsis": "use Net::LDAP::LDIF;\n$ldif = Net::LDAP::LDIF->new( \"file.ldif\", \"r\", onerror => 'undef' );\nwhile ( not $ldif->eof ( ) ) {\n$entry = $ldif->readentry ( );\nif ( $ldif->error ( ) ) {\nprint \"Error msg: \", $ldif->error ( ), \"\\n\";\nprint \"Error lines:\\n\", $ldif->errorlines ( ), \"\\n\";\n} else {\n# do stuff\n}\n}\n$ldif->done ( );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Net::LDAP::LDIF(3pm)  User Contributed Perl Documentation Net::LDAP::LDIF(3pm)",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "SPECIAL FEATURES",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "CONSTRUCTOR",
                "lines": 91,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 68,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "Net::LDAP::LDIF(3pm)  User Contributed Perl Documentation Net::LDAP::LDIF(3pm)": {
                "content": "",
                "subsections": []
            },
            "NAME": {
                "content": "Net::LDAP::LDIF - LDIF reading and writing\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Net::LDAP::LDIF;\n\n$ldif = Net::LDAP::LDIF->new( \"file.ldif\", \"r\", onerror => 'undef' );\nwhile ( not $ldif->eof ( ) ) {\n$entry = $ldif->readentry ( );\nif ( $ldif->error ( ) ) {\nprint \"Error msg: \", $ldif->error ( ), \"\\n\";\nprint \"Error lines:\\n\", $ldif->errorlines ( ), \"\\n\";\n} else {\n# do stuff\n}\n}\n$ldif->done ( );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Net::LDAP::LDIF provides a means to convert between Net::LDAP::Entry\nobjects and LDAP entries represented in LDIF format files. Reading and\nwriting are supported and may manipulate single entries or lists of\nentries.\n\nAs when reading an entire file into memory with perl normally, take\ninto account the possibility of memory use when loading an LDIF file in\none go.\n",
                "subsections": []
            },
            "SPECIAL FEATURES": {
                "content": "By default, Net::LDAP::LDIF supports reading attribute values from URLs\nof type \"file://\".\n\nWhen Gisle Aas' LWP module package is installed, Net::LDAP::LDIF uses\nit to also support reading data from the URL types supported by these\nmodules; most prominently \"http://\", \"https://\", and \"ftp://\"\nresources.  This extended feature is dynamically detected at runtime.\n",
                "subsections": []
            },
            "CONSTRUCTOR": {
                "content": "new ( FILE [[, MODE ], OPTIONS ] )\nOpen the file with the given mode.\n\n\"FILE\" may be the name of a file or an already open filehandle. If\n\"FILE\" begins or ends with a \"|\" then \"FILE\" will be passed\ndirectly to \"open\".\n\n\"MODE\" can be any of the modes allowed for Perl's open() function,\npotentially extended by PerlIO layers as described in perlopentut.\nAlternatively, it can be one of the mode indicators \"r\", \"r+\", \"w\",\n\"w+\", \"a\", \"a+\" known from C's fopen() function, which get mapped\nto their Perl counterparts.  If \"MODE\" is omitted, it defaults to\n\"r\" for reading.\n\n\"OPTIONS\" is a list of name/value pairs, recognizing:\n\nencode => 'none' | 'canonical' | 'base64'\nSome DN values in LDIF cannot be written verbatim and have to\nbe encoded in some way:\n\n'none'\nThe default.\n\n'canonical'\nSee \"canonicaldn\" in Net::LDAP::Util.\n\n'base64'\nUse base64.\n\nonerror => 'die' | 'warn' | 'undef'\nSpecify what happens when an error is detected.\n\n'die'\n\"Net::LDAP::LDIF\" will croak with an appropriate message.\n\n'warn'\n\"Net::LDAP::LDIF\" will warn with an appropriate message.\n\n'undef'\n\"Net::LDAP::LDIF\" will warn with an appropriate message if\n\"-w\" is in effect.  The method that was called will return\n\"undef\".\n\nNote this value is the string 'undef', not the \"undef\"\nvalue.\n\nchange => 1\nWrite entry changes to the LDIF file instead of the entries\nitself.  I.e. write LDAP operations acting on the entries to\nthe file instead of the entries contents.\n\nlowercase => 1\nConvert attribute names to lowercase when writing.\n\nsort => 1\nSort attribute names when writing entries according to the\nrule: objectclass first then all other attributes\nalphabetically sorted\n\nversion => '1'\nSet the LDIF version to write to the resulting LDIF file.\n\nAccording to RFC 2849 currently the only legal value for this\noption is 1.\n\nWhen this option is set Net::LDAP::LDIF tries to adhere more\nstrictly to the LDIF specification in RFC2489 in a few places.\n\nThe default is undef meaning no version information is written\nto the LDIF file.\n\nwrap => 78\nNumber of columns where output line wrapping shall occur.\n\nDefault is 78. Setting it to 40 or lower inhibits wrapping.\n\nraw => REGEX\nUse REGEX to denote the names of attributes that are to be\nconsidered binary when reading.\n\nWhen this option is given, Net::LDAP converts all values of\nattributes not matching this REGEX into Perl UTF-8 strings so\nthat the regular Perl operators (pattern matching, ...) can\noperate as one expects even on strings with international\ncharacters.\n\nIf this option is not given, attribute values are treated as\nbyte strings.\n\nExample: raw => qr/(?i:^jpegPhoto|;binary)/\n",
                "subsections": []
            },
            "METHODS": {
                "content": "readentry ( )\nRead one entry from the file and return it as a \"Net::LDAP::Entry\"\nobject.\n\nIn scalar mode, the \"Net::LDAP::Entry\" object is returned alone,\nwhile in list mode a list is returned consisting of the\n\"Net::LDAP::Entry\" object as first element followed by  all\n\"Net::LDAP::Control\" objects that were part of the LDIF entry.  See\nRFC 2849 for details.\n\neof ( )\nReturns true when the end of the file is reached.\n\nwriteentry ( ENTRY [, OPTIONS ], ... )\nWrite entries to the LDIF file.\n\nThe arguments accepted are a list of entries, optionally\ninterspersed with options belonging to the preceding entry.\n\nFor each entry, \"OPTIONS\" is a list of key-value pairs,\nrecognizing:\n\ncontrol => CONTROL\ncontrol => [ CONTROL, ... ]\nSee \"CONTROLS\" in Net::LDAP.\n\nwriteversion ( )\nIf the object's version is defined, this method allows one to\nexplicitly write the version before an entry is written.\n\nIf  not called explicitly, it gets called automatically when\nwriting the first entry.\n\nversion ( [ VERSION ] )\nIf called without arguments it returns the version of the LDIF file\nor undef if no version has been set.  If called with an argument it\nsets the LDIF version to VERSION.\n\nAccording to RFC 2849 currently the only legal value for VERSION is\n1.\n\nhandle ( )\nReturns the file handle the \"Net::LDAP::LDIF\" object reads from or\nwrites to.\n\ndone ( )\nThis method signals that the LDIF object is no longer needed. If a\nfile was opened automatically when the object was created it will\nbe closed. This method is called automatically via DESTROY when the\nobject goes out of scope.\n\nerror ( )\nReturns error message if error was found.\n\nerrorlines ( )\nReturns lines that resulted in error.\n\ncurrententry ( )\nReturns the current \"Net::LDAP::Entry\" object.\n\ncurrentlines ( )\nReturns the lines that generated the current \"Net::LDAP::Entry\"\nobject.\n\nnextlines ( )\nReturns the lines that will generate the next \"Net::LDAP::Entry\"\nobject.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Graham Barr <gbarr@pobox.com>.\n\nPlease report any bugs, or post any suggestions, to the perl-ldap\nmailing list <perl-ldap@perl.org>.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (c) 1997-2004 Graham Barr. All rights reserved. This program\nis free software; you can redistribute it and/or modify it under the\nsame terms as Perl itself.\n\nperl v5.32.0                      2021-01-03              Net::LDAP::LDIF(3pm)",
                "subsections": []
            }
        }
    }
}