Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Splitting an LDAP DN into its constiuent parts (groups)

by davis (Vicar)
on Jun 30, 2011 at 11:00 UTC ( #912149=perlquestion: print w/ replies, xml ) Need Help??
davis has asked for the wisdom of the Perl Monks concerning the following question:

Hi, long time, no see...

I can do this manually simply enough with a quick split and a map, but I suspect that the problem is common enough and possibly more complicated than I first thought to have been solved by a module. I cannot find such a module; I've looked at LDAP::uri and Net::LDAP, but I can't find anything that does what I think I want

I have a plain text string, containing an LDAP dn. It looks similar to this

cn=John Bull,ou=admins,ou=technical,ou=Staff,dc=example,dc=com
and I want to parse that such that I can easily answer the questions "Is user $foo in group $bar?", "Show me all the members of group $baz". Is there a module which does it for me?

davis

Comment on Splitting an LDAP DN into its constiuent parts (groups)
Download Code
Re: Splitting an LDAP DN into its constiuent parts (groups)
by Anonymous Monk on Jun 30, 2011 at 11:12 UTC

      Ah, I knew that it would have been well solved already. That looks perfect for my needs; thank you.


      davis

Re: Splitting an LDAP DN into its constiuent parts (groups)
by sundialsvc4 (Monsignor) on Jun 30, 2011 at 12:27 UTC

    Especially if yours is a well-known task (as in this case), it isn’t a question of whether CPAN has a module for it, but, how many and which one.   (Perl’s good, yes, but [IMHO...] CPAN is really what all the fuss is about, and very rightly so.)

      davis already knows this, because he did not ask if CPAN has a module, he asked which module/function he needed, and he already got his answer.

      You seriously need to stop trolling

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://912149]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-04-20 19:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (487 votes), past polls