in reply to Net::LDAP issues...

One thing that would help is checking error codes. That may tell you why things are failing. For example:
my $search = $ldap->bind; $search->code && die $search->error;

This is just a modified version of the code in the synopsis.

Replies are listed 'Best First'.
Re: Re: Net::LDAP issues...
by chrisj0 (Acolyte) on May 10, 2004 at 23:46 UTC
    I added
    $search->code && die $search->error;
    after:
    $search = $ldap->search( base=> "$base", filter=>"mail=$name_email" );
    I got the same error but with "code" instead of "count:
    Can't call method "code" without a package or object reference at c:\PROGRA~1\APACHE~1\apache\cgi-bin\PROCES~2.PL line 126

    Thanks,
    but it didn't fix it.
    chrisj

      Hrm. Three more thoughts. First, try printing out $search right after you call $ldap->search; that should tell you what type of object Perl thinks it is. Net::LDAP's search method is supposed to return a Net::LDAP::Search object. You might also want to make sure you have use Net::LDAP::Search at the top of your script; I'm not sure if Perl handles this automatically. Finally, make sure you check for an error after the bind method, since if that's failing it could explain why your other calls are failing.