Chris wrote:

> my %found = ();
> foreach (@emails) { $found{$_}++ };
> foreach (@exclude) { exists $found{$_} and delete $found{$_} }

Too complicated.  Check Wolf's suggestion:
$unwanted{$_} = 1 foreach @exclude;
my @temp;
push @temp
while (my $email = shift @emails) {
   push @temp, $email unless $unwanted{$email};
}
@emails = @temp;
@temp = undef;

>
> BUT, if I print out the hash with this:
> foreach my $key (keys %found) {
> print "$key\n";
> }
>
> The output comes up messed up for example:
> chris.com
>
> instead of:
> [EMAIL PROTECTED]

Your problem lies somewhere other than the code shown.  There is nothing in the
code above that perform internal manipulations on the data.

Please go through your code, paraphrase in English [or your spoken language of
daily use] what each line of code does, and post the code of lines likely to
deal more directly with the content of the data.

Overall, I see a conceptual problem here.  What is it that you are trying to
exclude the emails and patterns from?  Do you just want to expunge them from the
data store you extract, or do youwant to edit them out of the documentation?  If
it si only the former, then the code above should help to filter the specific
stringsyou are trying to exclude.  Patterns are a different matter, but lets
take this one step at a time, and defer the pattern hunt until you are on solid
ground with the exclusion code.

I see little hope of prducing automated edits without trashing the
documentation--at least without a much more clear specification.   Briefly put,
the editing of the text is a whole different issue that has not even been
touched thus far on this thread.

Joseph




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to