Hello all,

I've been trying to sort the data returned from my LDAP host, but I get 
the following error when I execute my script. Can any help?
I'm a newbie.

"Can't call method "Net::LDAP::Control::Sort" on an undefined value at 
./ldapsort.pl line 39, <FH> line 7."

Here is my code

use Net::LDAP qw(:all);
use Net::LDAP::Util qw(ldap_error_text);
use Net::LDAP::Control::Sort;
use Net::LDAP::Constant qw(LDAP_CONTROL_SORTRESULT);

open(FH. "< somefile");

while (<FH>)
{
($iid, $domain, $session, $minutes, $cost) = split(/  */, $line);
                        $sorted->Net::LDAP::Control::Sort->new(
                                order => "departmentnumber"
                        );
                        $sr = $ldapObject->search(
                                                base=> 'O=Wiley',
                                                scope=> 'sub',
                                                filter=> 
"(&(objectclass=jwsPerson)(uid=$iid))",
                                                control => [ $sorted ]
                        );

                        ($resp) = $sr->control( LDAP_CONTROL_SORTRESULT );

                        print "Results are sorted\n" if $resp and 
!$resp->result;
}
close(FH);

Reply via email to