in reply to Error while using stirct.
#!/usr/bin/perl -l use strict 'refs'; use warnings; use Net::LDAP; my $mesg = (); die "$@" unless my $ldap = Net::LDAP->new( 'www.example.com', 'timeout' => 2, 'debug' => 1, ); sub LDAPattrsearch { use strict; use warnings; $mesg->bind; my ($searchString, $Attrs, $base) = @_; unless ($base) { $base = "o=hostname.com"; } unless ($Attrs) { $Attrs = [ 'val1', 'val2', 'val3', 'val4']; } $mesg = $ldap->search( base => $base, filter => $searchString, attrs => $Attrs, ); $mesg = $ldap->code && $mesg->error; foreach my $entry ($mesg->entries) { $entry->dump; } $mesg->unbind; } undef $ldap; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Error while using stirct.
by singho (Novice) on May 11, 2012 at 09:37 UTC |