[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Understanding back_perl SampleLDAP.pm
- To: openldap-technical@openldap.org
- Subject: Understanding back_perl SampleLDAP.pm
- From: Marco Pizzoli <marco.pizzoli@gmail.com>
- Date: Fri, 18 Mar 2011 12:29:03 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=Gktn4f2W52LmqN+1jtxwLM+TUn978XdLb2yBK4nIqc0=; b=KOPC4HmTyKYyeebbKnXf7A+OTKnVpExP3HDBTsgCd7RYY0XuA10wUr8iVmjvXicElm jVz8yYbLtF6Q7Z1IroYHcy85lgmufJcDOcB9W2vuQt4g9MxPsd1JdosLqHsCqpUoKr55 sNkgSiDVEDxcCe6DOte7yZbHZbpcHqBGZuEbc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=fNxaqe3wlVla1rP7TxJrri/speF7KJoH4238tdT08LTAx4qV4EvCpK6sDFyY83Vi2z ewSUJ6Pcu5Ma/Wy+dPbXXIch6mPn0qakec6cG8NS+inR87LRbIFi5e+v5QW30xR/tR2i MY2SCIeTQOSFpr/vfzaz6bTLKbP4ICyDiXa6w=
Hi list,
could someone help me in understanding what the SampleLDAP.pm perl module do in its search routine?
This is the code:
--------
sub search {
my $this = shift;
my ( $base, $scope, $deref, $sizeLim, $timeLim, $filterStr, $attrOnly,
@attrs )
= @_;
print {*STDERR} "====$filterStr====\n";
$filterStr =~ s/\(|\)//gm;
$filterStr =~ s/=/: /m;
my @match_dn = ();
for my $dn ( keys %{$this} ) {
if ( $this->{$dn} =~ /$filterStr/imx ) {
push @match_dn, $dn;
last if ( scalar @match_dn == $sizeLim );
}
}
my @match_entries = ();
for my $dn (@match_dn) {
push @match_entries, $this->{$dn};
}
return ( 0, @match_entries );
}
--------
I'm interested in knowing what "keys %{$this}" should contain and why, in trying to use this sample perl module I cannot see any "key" of the array variable $this.
I configured the database in this way:
database perl
suffix "dc=perl,dc=com"
perlModulePath /tmp/appoggio/
perlModule SampleLDAP
Thanks in advance
Marco