{
    "mode": "perldoc",
    "parameter": "Net::LDAP::Control::Paged",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Net%3A%3ALDAP%3A%3AControl%3A%3APaged/json",
    "generated": "2026-06-11T20:06:25Z",
    "synopsis": "use Net::LDAP;\nuse Net::LDAP::Control::Paged;\nuse Net::LDAP::Constant qw( LDAPCONTROLPAGED );\n$ldap = Net::LDAP->new( \"ldap.mydomain.eg\" );\n$page = Net::LDAP::Control::Paged->new( size => 100 );\n@args = ( base     => \"cn=subnets,cn=sites,cn=configuration,$BASEDN\",\nscope    => \"subtree\",\nfilter   => \"(objectClass=subnet)\",\ncallback => \\&processentry, # Call this sub for each entry\ncontrol  => [ $page ],\n);\nmy $cookie;\nwhile (1) {\n# Perform search\nmy $mesg = $ldap->search( @args );\n# Only continue on LDAPSUCCESS\n$mesg->code  and last;\n# Get cookie from paged control\nmy($resp)  = $mesg->control( LDAPCONTROLPAGED )  or last;\n$cookie    = $resp->cookie;\n# Only continue if cookie is nonempty (= we're not done)\nlast  if (!defined($cookie) || !length($cookie));\n# Set cookie in paged control\n$page->cookie($cookie);\n}\nif (defined($cookie) && length($cookie)) {\n# We had an abnormal exit, so let the server know we do not want any more\n$page->cookie($cookie);\n$page->size(0);\n$ldap->search( @args );\n}",
    "sections": {
        "NAME": {
            "content": "Net::LDAP::Control::Paged - LDAPv3 Paged results control object\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Net::LDAP;\nuse Net::LDAP::Control::Paged;\nuse Net::LDAP::Constant qw( LDAPCONTROLPAGED );\n\n$ldap = Net::LDAP->new( \"ldap.mydomain.eg\" );\n\n$page = Net::LDAP::Control::Paged->new( size => 100 );\n\n@args = ( base     => \"cn=subnets,cn=sites,cn=configuration,$BASEDN\",\nscope    => \"subtree\",\nfilter   => \"(objectClass=subnet)\",\ncallback => \\&processentry, # Call this sub for each entry\ncontrol  => [ $page ],\n);\n\nmy $cookie;\nwhile (1) {\n# Perform search\nmy $mesg = $ldap->search( @args );\n\n# Only continue on LDAPSUCCESS\n$mesg->code  and last;\n\n# Get cookie from paged control\nmy($resp)  = $mesg->control( LDAPCONTROLPAGED )  or last;\n$cookie    = $resp->cookie;\n\n# Only continue if cookie is nonempty (= we're not done)\nlast  if (!defined($cookie) || !length($cookie));\n\n# Set cookie in paged control\n$page->cookie($cookie);\n}\n\nif (defined($cookie) && length($cookie)) {\n# We had an abnormal exit, so let the server know we do not want any more\n$page->cookie($cookie);\n$page->size(0);\n$ldap->search( @args );\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "\"Net::LDAP::Control::Paged\" provides an interface for the creation and manipulation of objects\nthat represent the \"pagedResultsControl\" as described by RFC 2696.\n\nThe control is allowed on LDAP search requests (\"search\" in Net::LDAP) only. On other operations\nit will - depending on the value of the parameter \"critical\" - either be ignored or lead to\nerrors.\n",
            "subsections": []
        },
        "CONSTRUCTOR ARGUMENTS": {
            "content": "In addition to the constructor arguments described in Net::LDAP::Control the following are\nprovided.\n\ncookie\nThe value to use as the cookie. This is not normally set when an object is created, but is\nset from the cookie value returned by the server. This associates a search with a previous\nsearch, so the server knows to return the page of entries following the entries it returned\nthe previous time.\n\nsize\nThe page size that is required. This is the maximum number of entries that the server will\nreturn to the search request.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "As with Net::LDAP::Control each constructor argument described above is also available as a\nmethod on the object which will return the current value for the attribute if called without an\nargument, and set a new value for the attribute if called with an argument.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Net::LDAP, Net::LDAP::Control, http://www.ietf.org/rfc/rfc2696.txt\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Graham Barr <gbarr@pobox.com>\n\nPlease report any bugs, or post any suggestions, to the perl-ldap mailing list\n<perl-ldap@perl.org>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (c) 2000-2004 Graham Barr. All rights reserved. This program is free software; you can\nredistribute it and/or modify it under the same terms as Perl itself.\n",
            "subsections": []
        }
    },
    "summary": "Net::LDAP::Control::Paged - LDAPv3 Paged results control object",
    "flags": [],
    "examples": [],
    "see_also": []
}