{
    "content": [
        {
            "type": "text",
            "text": "# Net::LDAP::Entry (info)\n\n## NAME\n\nNet::LDAP::Entry - An LDAP entry object\n\n## SYNOPSIS\n\nuse Net::LDAP;\n$ldap = Net::LDAP->new ( $host );\n$mesg = $ldap->search ( @searchargs );\nmy $max = $mesg->count;\nfor ( $i = 0 ; $i < $max ; $i++ ) {\nmy $entry = $mesg->entry ( $i );\nforeach my $attr ( $entry->attributes ) {\nprint join( \"\\n \", $attr, $entry->getvalue( $attr ) ), \"\\n\";\n}\n}\n# or\nuse Net::LDAP::Entry;\n$entry = Net::LDAP::Entry->new;\n$entry->dn($dn);\n$entry->add (\nattr1 => 'value1',\nattr2 => [ qw(value1 value2) ]\n);\n$entry->delete ( 'unwanted' );\n$entry->replace (\nattr1 => 'newvalue',\nattr2 => [ qw(new values) ]\n);\n$entry->update ( $ldap ); # update directory server\n$entry2 = $entry->clone; # copies entry\n# new alternate syntax\n$entry = Net::LDAP::Entry->new ( $dn,\nattr1 => 'value1',\nattr2 => [ qw(value1 value2) ]\n)->add(\nattr3   => 'value'\n)->update( $ldap );\n\n## DESCRIPTION\n\nThe Net::LDAP::Entry object represents a single entry in the directory.\nIt is a container for attribute-value pairs.\n\n## Sections\n\n- **Net::LDAP::Entry(3pm) User Contributed Perl DocumentationNet::LDAP::Entry(3pm)**\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONSTRUCTORS**\n- **METHODS**\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::LDAP::Entry",
        "section": "",
        "mode": "info",
        "summary": "Net::LDAP::Entry - An LDAP entry object",
        "synopsis": "use Net::LDAP;\n$ldap = Net::LDAP->new ( $host );\n$mesg = $ldap->search ( @searchargs );\nmy $max = $mesg->count;\nfor ( $i = 0 ; $i < $max ; $i++ ) {\nmy $entry = $mesg->entry ( $i );\nforeach my $attr ( $entry->attributes ) {\nprint join( \"\\n \", $attr, $entry->getvalue( $attr ) ), \"\\n\";\n}\n}\n# or\nuse Net::LDAP::Entry;\n$entry = Net::LDAP::Entry->new;\n$entry->dn($dn);\n$entry->add (\nattr1 => 'value1',\nattr2 => [ qw(value1 value2) ]\n);\n$entry->delete ( 'unwanted' );\n$entry->replace (\nattr1 => 'newvalue',\nattr2 => [ qw(new values) ]\n);\n$entry->update ( $ldap ); # update directory server\n$entry2 = $entry->clone; # copies entry\n# new alternate syntax\n$entry = Net::LDAP::Entry->new ( $dn,\nattr1 => 'value1',\nattr2 => [ qw(value1 value2) ]\n)->add(\nattr3   => 'value'\n)->update( $ldap );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Net::LDAP::Entry(3pm) User Contributed Perl DocumentationNet::LDAP::Entry(3pm)",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 46,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "CONSTRUCTORS",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 228,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "Net::LDAP::Entry(3pm) User Contributed Perl DocumentationNet::LDAP::Entry(3pm)": {
                "content": "",
                "subsections": []
            },
            "NAME": {
                "content": "Net::LDAP::Entry - An LDAP entry object\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Net::LDAP;\n\n$ldap = Net::LDAP->new ( $host );\n$mesg = $ldap->search ( @searchargs );\n\nmy $max = $mesg->count;\nfor ( $i = 0 ; $i < $max ; $i++ ) {\nmy $entry = $mesg->entry ( $i );\nforeach my $attr ( $entry->attributes ) {\nprint join( \"\\n \", $attr, $entry->getvalue( $attr ) ), \"\\n\";\n}\n}\n\n# or\n\nuse Net::LDAP::Entry;\n\n$entry = Net::LDAP::Entry->new;\n\n$entry->dn($dn);\n\n$entry->add (\nattr1 => 'value1',\nattr2 => [ qw(value1 value2) ]\n);\n\n$entry->delete ( 'unwanted' );\n\n$entry->replace (\nattr1 => 'newvalue',\nattr2 => [ qw(new values) ]\n);\n\n$entry->update ( $ldap ); # update directory server\n\n$entry2 = $entry->clone; # copies entry\n\n# new alternate syntax\n\n$entry = Net::LDAP::Entry->new ( $dn,\nattr1 => 'value1',\nattr2 => [ qw(value1 value2) ]\n)->add(\nattr3   => 'value'\n)->update( $ldap );\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The Net::LDAP::Entry object represents a single entry in the directory.\nIt is a container for attribute-value pairs.\n\nA Net::LDAP::Entry object can be used in two situations. The first and\nprobably most common use is in the result of a search to the directory\nserver.\n\nThe other is where a new object is created locally and then a single\ncommand is sent to the directory server to add, modify or replace an\nentry. Entries for this purpose can also be created by reading an LDIF\nfile with the Net::LDAP::LDIF module.\n",
                "subsections": []
            },
            "CONSTRUCTORS": {
                "content": "new ( )\nCreate a new entry object with the changetype set to 'add'.\nOptionally, you can provide a DN and a list of arguments passed to\nthe add method.\n\nNet::LDAP::Entry->new()\n\n# or\nNet::LDAP::Entry->new( $dn )\n\n# or\nNet::LDAP::Entry->new( $dn ,\nobjectClass => [qw( top posixAccount )] , uid => 'admin'\n)\n\nclone ( )\nReturns a copy of the Net::LDAP::Entry object.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "add ( ATTR => VALUE, ... )\nAdd more attributes or values to the entry and returns the entry\nitself. Each \"VALUE\" should be a string if only a single value is\nwanted in the attribute, or a reference to an array of strings if\nmultiple values are wanted. The values given will be added to the\nvalues which already exist for the given attributes.\n\n$entry->add ( 'sn' => 'Barr' );\n\n$entry->add ( 'street' => [ '1 some road','nowhere' ] );\n\nNOTE: these changes are local to the client and will not appear on\nthe directory server until the \"update\" method is called. As \"add\"\nreturns the entry, you can write something like.\n\n$entry->add ( 'sn' => 'Barr' )->update( $ldap );\n\nattributes ( OPTIONS )\nReturn a list of attributes in this entry\n\nnooptions => 1\nReturn a list of the attribute names excluding any options. For\nexample for the entry\n\nname: Graham Barr\nname;en-us: Bob\njpegPhoto;binary: binary data\n\nthen\n\n@values = $entry->attributes;\nprint \"default: @values\\n\";\n\n@values = $entry->attributes ( nooptions => 1 );\nprint \"nooptions: @values\\n\";\n\nwill output\n\ndefault: name name;en-us jpegPhoto;binary\nnooptions: name jpegPhoto\n\nchangetype ( )\nReturns the type of operation that would be performed when the\nupdate method is called.\n\nchangetype ( TYPE )\nSet the type of operation that will be performed when the update\nmethod is called to \"TYPE\". Returns the entry itself.\n\nPossible values for \"TYPE\" are\n\nadd The update method will call the add method on the client\nobject, which will result in the entry being added to the\ndirectory server.\n\ndelete\nThe update method will call the delete method on the client\nobject, which will result in the entry being removed from the\ndirectory server.\n\n$entry->delete->update( $ldap )\n\nmodify\nThe update method will call the modify method on the client\nobject, which will result in any changes that have been made\nlocally being made to the entry on the directory server.\n\nmoddn/modrdn\nThe update method will call the moddn method on the client\nobject, which will result in any DN changes that have been made\nlocally being made to the entry on the directory server. These\nDN changes are specified by setting the entry attributes\nnewrdn, deleteoldrdn, and (optionally) newsuperior.\n\ndelete ( )\nDelete the entry from the server on the next call to \"update\".\n\ndelete ( ATTR => [ VALUE, ... ], ... )\nDelete the values of given attributes from the entry. Values are\nreferences to arrays; passing a reference to an empty array is the\nsame as passing \"undef\", and will result in the entire attribute\nbeing deleted. For example:\n\n$entry->delete ( 'mail' => [ 'foo.bar@example.com' ] );\n$entry->delete ( 'description' => [ ], 'streetAddress' => [ ] );\n\nNOTE: these changes are local to the client and will not appear on\nthe directory server until the \"update\" method is called.\n\ndn ( )\nGet the DN of the entry.\n\ndn ( DN )\nSet the DN for the entry, and return the previous value.\n\nNOTE: these changes are local to the client and will not appear on\nthe directory server until the \"update\" method is called.\n\nldif ( OPTION => VALUE, ... )\nReturns the entry as an LDIF string. Possible options are all\noptions \"new\" in Net::LDAP::LDIF allows, with two being treated\nspecial:\n\nchange => VALUE\nIf given a true value then the LDIF will be generated as a\nchange record.  If false, then the LDIF generated will\nrepresent the entry content. If unspecified then it will\ndefault to true if the entry has changes and false if no\nchanges have been applied to the entry.\n\nversion => VALUE\nNo matter what value is passed, it will be ignored, and treated\nas if 0 were given.\n\ndump ( [ FILEHANDLE ] )\nDump the entry to the given filehandle.\n\nThis method is intended for debugging purposes and does not treat\nbinary attributes specially.  It also does not deal properly with\nentries resulting from LDIF change records.\n\nSee Net::LDAP::LDIF on how to generate LDIF output.\n\nIf \"FILEHANDLE\" is omitted \"STDOUT\" is used by default.\n\nexists ( ATTR )\nReturns \"TRUE\" if the entry has an attribute called \"ATTR\".\n\ngetvalue ( ATTR, OPTIONS )\nGet the values for the attribute \"ATTR\". In a list context returns\nall values for the given attribute, or the empty list if the\nattribute does not exist. In a scalar context returns the first\nvalue for the attribute or undef if the attribute does not exist.\n\nalloptions => 1\nThe result will be a hash reference. The keys of the hash will\nbe the options and the hash value will be the values for those\nattributes.  For example if an entry had:\n\nname: Graham Barr\nname;en-us: Bob\n\nThen a get for attribute \"name\" with alloptions set to a true\nvalue\n\n$ref = $entry->getvalue ( 'name', alloptions => 1 );\n\nwill return a hash reference that would be like\n\n{\n''       => [ 'Graham Barr' ],\n';en-us' => [ 'Bob' ]\n}\n\nIf alloptions is not set or is set to false only the attribute\nvalues for the exactly matching name are returned.\n\nnooptions => 1\nInstead of only returning the values of the exactly matching\nattribute name, get the attribute values of all attributes with\nthe base name given.  I.e. in the example above, calling\n\n@array = $entry->getvalue ( 'name', nooptions => 1 );\n\nwill yield\n\n( 'Graham Barr', 'Bob' )\n\nThe name of this option has neen chosen for consistency with\nthe equally named option in the attributes method.\n\nasref => 1\nThe result will be a reference to an array containing all the\nvalues for the attribute, or \"undef\" if the attribute does not\nexist.\n\n$scalar = $entry->getvalue ( 'name' );\n\n$scalar will be the first value for the \"name\" attribute, or\n\"undef\" if the entry does not contain a \"name\" attribute.\n\n$ref = $entry->getvalue ( 'name', asref => 1 );\n\n$ref will be a reference to an array, which will have all the\nvalues for the \"name\" attribute. If the entry does not have an\nattribute called \"name\" then $ref will be \"undef\".\n\nNOTE: In the interest of performance the array references returned\nby \"getvalue\" may be references to structures held inside the\nentry object. These values and their contents should NOT be\nmodified directly.\n\nreplace ( ATTR => VALUE, ... )\nSimilar to \"add\", except that the values given will replace any\nvalues that already exist for the given attributes.\n\nNOTE: these changes are local to the client and will not appear on\nthe directory server until the \"update\" method is called.\n\nupdate ( CLIENT [, OPTIONS ] )\nUpdate the directory server with any changes that have been made\nlocally to the attributes of this entry. This means any calls that\nhave been made to add, replace or delete since the last call to\nchangetype or update was made.\n\nThis method can also be used to modify the DN of the entry on the\nserver, by specifying moddn or modrdn as the changetype, and\nsetting the entry attributes newrdn, deleteoldrdn, and (optionally)\nnewsuperior.\n\n\"CLIENT\" is a \"Net::LDAP\" object where the update will be sent to.\n\n\"OPTIONS\" may be options to the \"Net::LDAP\" actions on CLIENT\ncorresponding to the entry's changetype.\n\nThe result will be an object of type Net::LDAP::Message as returned\nby the add, modify or delete method called on CLIENT.\n\nAlternatively \"CLIENT\" can also be a \"Net::LDAP::LDIF\" object, that\nmust be an LDIF file opened for writing.\n\nIn this case, the entry, together with any \"OPTIONS\" is passed as\narguments to the \"writeentry\" method of the \"CLIENT\" object.\n\nHere too, the result is an object class \"Net::LDAP::Message\".  On\nerror, the error code is \"LDAPOTHER\" with the LDIF error message\nin the error text.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Net::LDAP, Net::LDAP::LDIF\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::Entry(3pm)",
                "subsections": []
            }
        }
    }
}