"Not an ARRAY reference" in rt-ldapimport

rt-ldapimport throws the following error:

Not an ARRAY reference at /opt/rt5/sbin/…/lib/RT/LDAPImport.pm line 426

According to Net::LDAP Methods (Perl in a Nutshell, 2nd Edition) the “options” parameter must to be a HASH, not an ARRAY.
I changed lines 425-426 in /opt/rt5/sbin/lib/RT/LDAPImport.pm from:

$RT::LDAPOptions = unless $RT::LDAPOptions;
my $ldap = Net::LDAP->new($RT::LDAPHost, @$RT::LDAPOptions);

to:

$RT::LDAPOptions = {} unless $RT::LDAPOptions;
my $ldap = Net::LDAP->new($RT::LDAPHost, %$RT::LDAPOptions);

and also $LDAPOptions in RT_Siteconfig.pm to curly brackets (maybe the example at RT::LDAPImport - RT 5.0.5 Documentation - Best Practical is wrong). From

Set($LDAPOptions, [ port => 636,
scheme => ‘ldaps’,
version => 3 ]);

to

Set($LDAPOptions, { port => 636,
scheme => ‘ldaps’,
version => 3 });

As I saw it’s configured $LDAPMapping.

It’s connecting right now, so I presume it is correct Any suggestion?

Forget about this post :man_facepalming: I don’t know what really happened to my configuration. I reverted changes and it’s working wright now. Too many times the bug is in my brain, not in the code.