From: Wizard <wi...@ne...> - 2003-02-17 16:22:01
|
That's fine, 2 to 1 against. I've replaced the code with: foreach( split /\,\s*/, $blocked_users ) { push @bad_users, $_; } $user =~ s/^\s*(.*)\s*/$1/; @fail = ( 0, "ALLOWED" ); foreach( @bad_users ) { $_ =~ s/^\s*(.*)\s*/$1/; if( (length( $_ ) == length( $user )) && index( $user, $_) != -1 ) { @fail = ( 1, "$_" ); } } return @fail; This will require an exact match between the blocked string and the entered email address. It returns an array of: ( 1|0, "ALLOWED"|"string_matched" ) I plan on profiling this against a grep, but I suspect that this is faster. Grant M. > -----Original Message----- > From: nms...@li... > [mailto:nms...@li...]On Behalf Of Nick > Cleaton > Sent: Monday, February 17, 2003 2:27 AM > To: Wizard > Cc: Simon Wilcox; nms-devel > Subject: Re: Organisation filtering RE: [Nms-cgi-devel] > Anyone...Anyone...? > > > On Fri, Feb 14, 2003 at 07:12:27AM -0500, Wizard wrote: > > > > Please, ANYONE, feel free to say "Grant, you're an idiot!". As > long as you > > don't call my mother names, I'm pretty open to criticism ;-) > > > > Grant, you're committing too much effort on a peripheral feature. Not > just development effort now, but support and development effort in the > future as well. > > I don't think the feature is worth the complexity it will add to code, > documentation and testing. > > -- > Nick > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Nms-cgi-devel mailing list > Nms...@li... > https://lists.sourceforge.net/lists/listinfo/nms-cgi-devel > |