1Net::LDAP::Control::SorUts(e3r)Contributed Perl DocumentNaetti:o:nLDAP::Control::Sort(3)
2
3
4
6 Net::LDAP::Control::Sort - Server Side Sort (SSS) control object
7
9 use Net::LDAP::Control::Sort;
10 use Net::LDAP::Constant qw(LDAP_CONTROL_SORTRESULT);
11
12 $sort = Net::LDAP::Control::Sort->new(
13 order => "cn -phone"
14 );
15
16 $mesg = $ldap->search( @args, control => [ $sort ]);
17
18 ($resp) = $mesg->control( LDAP_CONTROL_SORTRESULT );
19
20 print "Results are sorted\n" if $resp and !$resp->result;
21
23 "Net::LDAP::Control::Sort" is a sub-class of Net::LDAP::Control. It
24 provides a class for manipulating the LDAP Server Side Sort (SSS)
25 request control 1.2.840.113556.1.4.473 as defined in RFC-2891
26
27 If the server supports sorting, then the response from a search opera‐
28 tion will include a sort result control. This control is handled by
29 Net::LDAP::Control::SortResult.
30
32 order
33 A string which defines how entries may be sorted. It consists of
34 multiple directives, spearated by whitespace. Each directive
35 describes how to sort entries using a single attribute. If two
36 entries have identical attributes, then the next directive in the
37 list is used.
38
39 Each directive specifies a sorting order as follows
40
41 -attributeType:orderingRule
42
43 The leading "-" is optional, and if present indicates that the
44 sorting order should be reversed. "attributeType" is the attribute
45 name to sort by. "orderingRule" is optional and indicates the rule
46 to use for the sort and should be valid for the given "attribute‐
47 Type".
48
49 Any one attributeType should only appear once in the sorting list.
50
51 Examples
52
53 "cn" sort by cn using the default ordering rule for the cn attribute
54 "-cn" sort by cn using the reverse of the default ordering rule
55 "age cn" sort by age first, then by cn using the default ordering rules
56 "cn:1.2.3.4" sort by cn using the ordering rule defined as 1.2.3.4
57
59 As with Net::LDAP::Control each constructor argument described above is
60 also available as a method on the object which will return the current
61 value for the attribute if called without an argument, and set a new
62 value for the attribute if called with an argument.
63
65 Net::LDAP, Net::LDAP::Control::SortResult, Net::LDAP::Control,
66 http://www.ietf.org/rfc/rfc2891.txt
67
69 Graham Barr <gbarr@pobox.com>
70
71 Please report any bugs, or post any suggestions, to the perl-ldap mail‐
72 ing list <perl-ldap@perl.org>
73
75 Copyright (c) 1999-2004 Graham Barr. All rights reserved. This program
76 is free software; you can redistribute it and/or modify it under the
77 same terms as Perl itself.
78
79
80
81perl v5.8.8 2007-02-10 Net::LDAP::Control::Sort(3)