And forgive me for beating this to a pulp, but... 

The original double foreach loop looks to have split for each $line on
all the ' ' (spaces) to create a word list, not a line list.

Which should catch the number of that words that meet this obfu rule not
lines.

Lastly, given that you say eval can't return the count, you could put an
if statement saying if $count > 15 (or whatever) then return 1 otherwise
return 0.  Obviously the power of using $count is somewhat defeated in
this incantation, but it is still useful..  Just not as useful.

Steven

> sub weird_words {
>      my ($self, $fulltext) = @_;
>      my $count = 0;
>      # Get the text
>      $fulltext = $self->get_decoded_body_text_array();
>      foreach my $line ( @{$fulltext} ) {
>       my @words = split(' ',$line);
>       foreach my $word ( @words ) {
>           if ( $word =~
> /([a-z,A-Z]+)[EMAIL PROTECTED]:;|\\,.]([a-z,A-Z]+)/ ) {
>                                       $count++;
>           }   
>       }
>     }
>     return $count;
> }

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Matt
Kettler
Sent: Monday, December 08, 2003 9:50 AM
To: Mike Kuentz (2); Brendan Burns;
[EMAIL PROTECTED]
Subject: RE: [SAtalk] Weird Word patch


At 11:22 AM 12/8/2003, Mike Kuentz (2) wrote:
>Eval's return true/false if I'm not mistaken.

Yes, they do.. But I suspect perl is like C, where any nonzero return
value 
is "true".

So it's less useful than it appears to return a count, but not harmful.

It's probably better style to do what most of the standard Eval tests
do, 
and do a conditional and return 1. This way you could also increase the 
threshold to something greater than 1 instance of punctuation surrounded
by 
letters.


>So any line with a comma or period would hit.

No, any line with a comma or period sandwiched between two alpha's would

hit.. no spaces allowed, no end-of-line's allowed in between. (sa does 
remove EOLs from body text, but I believe they are replaced by spaces. 
Otherwise rules wouldn't work very well).

ie:

this. will not hit

this.will hit








-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for
IBM's Free Linux Tutorials.  Learn everything from the bash shell to sys
admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Spamassassin-talk mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to