I am rather new at Perl but I have searched to no end for a reason why my subroutine modifyAD will not return a result using the search filter. The search filter for the subroutine modifyLDAP returns valid results. Connection isn't the reason why I am not returning any results as I do enter the subroutine, it never enters the if statement in the code and goes to the else if statement. The input variable is not the reason either as the value is printed correctly in the logfile
$ldap is searching a Sun LDAP Enterprise Directory server
$AD is searching an Active Directory via Net::LDAP::
Any suggestions would be very helpful!
$ldap is searching a Sun LDAP Enterprise Directory server
$AD is searching an Active Directory via Net::LDAP::
Any suggestions would be very helpful!
sub modifyLDAP
{
$result = $ldap->search(filter=>"(attribute)",
base=>"ou=value,dc=value,dc=value",
attrs=>['attribute','attribute','attribute', 'attribute']);
if ($result->count ==1)
{
code
}
}
sub modifyAD
{
$result = $AD->search(filter=>"(&(objectClass=*)(attribute=$input)",
base=>"ou=value,dc=value,dc=value",,
attrs=>['attribute','attribute','attribute', 'attribute']);
if ($result->count ==1)
{
code
}
elsif ($result->count ==0)
{
print LOGFILE "Zero entries for " . attribute . "\n";
$countMatch0 = $countMatch0 + 1;
}
}
