===== SEARCH
dn: cn=Full,ou=Users,o=Test Data,c=nz
cn: Full
===== SEARCH_S
dn: cn=Full,ou=Users,o=Test Data,c=nz
cn: Full
sn: Last
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
givenName: First
search() looks like the following:
sub search
{
...;
if( !defined($attrs) ) {
my @null_array = ();
$attrs = \@null_array;
}
...
}
search_s() looks like the following:
sub search_s
{
...;
if( !defined($attrs) == undef ) {
my @null_array = ();
$attrs = \@null_array;
}
...;
}
I think the conditional in search_s() is being parsed as:
if (!(defined($attrs) == undef)) {
}
In effect, if $attrs isn't passed at all, it's essentially a NOP - $attrs = undef and defined(undef) == undef.
But if $attrs is passed, defined($attrs) != undef - so the negation proceeds into the conditional block.
The following code:
produces the following output:
search() looks like the following:
search_s() looks like the following:
I think the conditional in search_s() is being parsed as:
In effect, if $attrs isn't passed at all, it's essentially a NOP - $attrs = undef and defined(undef) == undef. But if $attrs is passed, defined($attrs) != undef - so the negation proceeds into the conditional block.
I'll submit a pull request for this shortly. :)