in reply to Net::LDAP giving I/O Error

Your BIND statement:
my $mesg = $ldap->bind( 'sasl' => $sasl, version => 3 ) or die "$@";
Does not seem to follow the LDAP bind syntax, which requires the first argument to be a DN to bind/authenticate to.

I believe you are getting an authorization error (5), since you try to do a search using what looks like an anonymous bind. </c>

        ...it is unhealthy to remain near things that are in the process of blowing up.     man page for WARP, by Larry Wall

Replies are listed 'Best First'.
Re^2: Net::LDAP giving I/O Error
by dvl (Initiate) on Oct 11, 2016 at 19:14 UTC

    Also, this morning, after my Kerberos ticket had expired overnight, I received this output when I ran the script:

    Failed to set version: GSSAPI Error (init): Miscellaneous failure (see + text) Ticket expired
    That tells me that GSSAPI is being used.
Re^2: Net::LDAP giving I/O Error
by dvl (Initiate) on Oct 11, 2016 at 19:06 UTC
    Thank you. I neglected to include: I'm running a kinit from my shell before running this script. I have a valid Kerberos ticket and that is why I specify GSSAPI. That is the intended use case. Does that help?
      I'm not familiar with GSSAPI, but Tim Bishop's Blog has a discussion, and supposedly working code for this.

              ...it is unhealthy to remain near things that are in the process of blowing up.     man page for WARP, by Larry Wall

        Thank you. My coworker found the fix, by looking at other scripts.
        18c18 < my $ldap = Net::LDAP->new($dc, port => 636, scheme => 'ldaps') or di +e "$@"; --- > my $ldap = Net::LDAP->new($dc) or die "$@";
        i.e. reduce the parameters to the LDAP constructor. *shrug*