URI::ldap(3)
π URI::ldap β LDAP Uniform Resource Locators π¦
Okay bestie, so this is the URI::ldap page from the Perl manual (that's URI::ldap(3), from perl v5.42.0) and it's literally the whole scoop on getting LDAP URLs to behave. LDAP Uniform Resource Locators, no cap. Let's get into it β¨
πΈ NAME πΈ
URI::ldap β LDAP Uniform Resource Locators. That's the vibe. That's the whole thing. π
β¨ SYNOPSIS β¨
Here's how you actually touch it, copy-paste ready:
use URI;
$uri = URI->new("ldap:$uri_string");
$dn = $uri->dn;
$filter = $uri->filter;
@attr = $uri->attributes;
$scope = $uri->scope;
%extn = $uri->extensions;
$uri = URI->new("ldap:"); # start empty
$uri->host("ldap.itd.umich.edu");
$uri->dn("o=University of Michigan,c=US");
$uri->attributes(qw(postalAddress));
$uri->scope('sub');
$uri->filter('(cn=Babs Jensen)');
print $uri->as_string,"\n";
Like, you can parse one that already exists, or you can start from an empty "ldap:" and build the whole thing up piece by piece. Main character energy either way π
π DESCRIPTION π
URI::ldap hands you an interface to parse an LDAP URI into its constituent parts β and also to build a URI from scratch, exactly as described in RFC 2255. Both directions. Iconic. π«Ά
π METHODS π
URI::ldap supports all the generic and server methods defined by URI, plus the following ones down here. Slay.
Each of these methods can be used to set or get the value in the URI. The values are passed in unescaped form (important!!). None of these return undefined values, but heads up: elements without a default can be empty. If arguments are given, then a new value is set for the given part of the URI. Simple as that π¦
$uri->dn( [$new_dn] )β Sets or gets the Distinguished Name part of the URI. The DN identifies the base object of the LDAP search. It's giving "where do I even start looking" π«$uri->attributes( [@new_attrs] )β Sets or gets the list of attribute names which are returned by the search. Like your lil shopping list of what comes back π$uri->scope( [$new_scope] )β Sets or gets the scope to be used by the search. The value can be one of"base","one"or"sub". If none is given in the URI then the return value defaults to"base". Defaults! We love a safety net β¨$uri->_scope( [$new_scope] )β Same asscope(), but does not default to anything. Raw. Unfiltered. (Well, unscoped π)$uri->filter( [$new_filter] )β Sets or gets the filter to be used by the search. If none is given in the URI then the return value defaults to"(objectClass=*)". That's the fallback queen right there π$uri->_filter( [$new_filter] )β Same asfilter(), but does not default to anything. No net, no defaults, just vibes π$uri->extensions( [$etype => $evalue,...] )β Sets or gets the extensions used for the search. The list passed should be in the formetype1 => evalue1, etype2 => evalue2,...β and ngl, that's also the form of list that gets returned. Symmetry, we stan π
π₯ SEE ALSO π₯
The RFC herself, go read it bestie: <http://tools.ietf.org/html/rfc2255>
π AUTHOR π
Graham Barr <gbarr@pobox.com> β original icon π
Slightly modified by Gisle Aas to fit into the URI distribution. Teamwork fr fr π«Ά
π§ COPYRIGHT π§
Copyright (c) 1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Quick reminder bestie: values go in unescaped,scope()andfilter()have defaults, and the underscore versions (_scope,_filter) do not. Don't mix 'em up π
And that's the page! π Source: perl v5.42.0, dated 2026-09-02 β that's URI::ldap(3), from the User Contributed Perl Documentation, mwah π
π¦ where this page comes from
- opensuse-leap 16.0: perl-URI 5.310.0-160000.3.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms