|
Peter, Peter Marschall schreef: I appreciate your eye for detail regarding the vars, however the reordering of the code broke the module.Hi, On Wednesday, 18. January 2006 21:30, [EMAIL PROTECTED] wrote:sounds like a reasonable wish ( see attached patch ;-) Allowing developers to specify their own matching module instead of the ones we pre-cooked is a little tricky since every module uses a different name for the match method and other peculiarities. We could allow for: The import must be in the Net::LDAP::FilterMatch section or else it will not be called on import. To ensure that I catch the vars errors myself (:-) I have made the module strict again. That should cover most of these kind of typo's. The attached patch repairs the import and also covers the strictness. Cheers, Hans ps.if I find the time I'll try to make a test for this module. |
Index: FilterMatch.pm
===================================================================
--- FilterMatch.pm (revision 488)
+++ FilterMatch.pm (working copy)
@@ -12,12 +12,20 @@
package Net::LDAP::FilterMatch;
+use strict;
use Net::LDAP::Filter;
use Net::LDAP::Schema;
use vars qw($VERSION);
-$VERSION = '0.16';
+$VERSION = '0.17';
+sub import {
+ shift;
+
+ push(@_, @Net::LDAP::Filter::approxMatchers) unless @_;
+ @Net::LDAP::Filter::approxMatchers = grep { eval "require $_" } @_ ;
+}
+
package Net::LDAP::Filter;
use vars qw(@approxMatchers);
@@ -27,14 +35,6 @@
Text::Soundex
);
-sub import {
- shift;
-
- push(@_, @Net::LDAP::Filter::approxMatchers) unless @_;
- @Net::LDAP::Filter::approxMatchers = grep { eval "require $_" } @_ ;
-}
-
-
sub _filterMatch($@);
sub _cis_equalityMatch($@);
@@ -162,7 +162,7 @@
$match='_cis_' . $op;
}
- return &$match($assertion,$op,@values);
+ return eval( "$match".'($assertion,$op,@values)' ) ;
}
return undef; # all other filters => fail with error
