Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Ldapsearch help

by gopalr (Priest)
on Sep 04, 2007 at 10:28 UTC ( #636889=perlquestion: print w/ replies, xml ) Need Help??
gopalr has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am using Unix and the following command successfully run in command prompt. But when we embed in CGI, the results is not found. ie. array is not getting any values

$cdsCmd="/opt/totalnet/sbin/ldapsearch uid=USERID -h ldaps://xxx.c om:636 -D xxxGID=xxxxx, ou=Employee,ou=People,o=Company,c=US -w PASSWD + ARGUMENTS"; @cdsValues = `$cdsCmd`; print @cdsValues;

Please guide me in this regard

Thanks in Adavnce

Comment on Ldapsearch help
Download Code
Replies are listed 'Best First'.
Re: Ldapsearch help
by grinder (Bishop) on Sep 04, 2007 at 10:50 UTC

    Perhaps the backticked command is failing. Maybe you should use IPC::Open3 to keep track of both STDOUT and STDERR. Otherwise $? will give a clue as to whether it succeeded or not.

    Another alternative is to use the Net::LDAP module, which allows you to perform LDAP queries directly from Perl. In this way you can see exactly where and when in fails, and also possibly tailor the search to return exactly what you need and not have to post-process the results of @cdsValues.

    • another intruder with the mooring in the heart of the Perl

Re: Ldapsearch help
by ghenry (Vicar) on Oct 17, 2007 at 15:33 UTC

    Learn to use ldapsearch correctly.

    man ldapsearch

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a Just ask!!!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2015-11-27 21:11 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (732 votes), past polls