Likely what is happening is that "$mesg" is not receiving valid data back from $ldap->search. You may just have a single bad entry in your test.txt file.
At a minimum you will want to add a line that tests the value of $entry, like so:
my $entry = $mesg->shift_entry(); next unless $entry;
In order to skip over any bad entries in your input text file. Of course you should probably do proper error reporting as well.
To debug this further you can use Data::Dumper and show the return results of the search function. If my guess is correct you will see 'errorMessage => "Bad filter"' in the returned hash:
HTH.use Data::Dumper; ... $mesg = $ldap->search ( @args ) or die $!; print Dumper $mesg;
In reply to Re: Perl LDAP script error "Can't call method "dn" on an undefined value"
by Loops
in thread Perl LDAP script error "Can't call method "dn" on an undefined value"
by anakin30
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |