FPs and SA 3.2.0

Julian Field MailScanner at ecs.soton.ac.uk
Mon May 21 16:10:08 IST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Paul Bijnens wrote:
> On 2007-05-16 17:41, Julian Field wrote:
>   
>> I'll put it in the main codebase then. Perl has some very subtle bugs in 
>> it...
>>     
>
> I believe I don't need to teach perl to Julian (rather the other way
> around :-) ), but anyway...
>
>   
>>>>>       
>>>>>           
>>>>>>   # JKF 3/10/2005
>>>>>>   my $temp = @HitList;
>>>>>>   $temp = $temp + 0;
>>>>>>   $temp = 0 unless $HitList[0] =~ /a-z/i;
>>>>>>   return ($temp, join(', ', @HitList));
>>>>>> }
>>>>>>
>>>>>> Let's see if that helps. According to the book, the 2 middle lines
>>>>>> shouldn't be needed at all.
>>>>>>             
>
> To me this seems like the array @HitList contains an empty or undef
> value.  The match against "/[a-z]/i"   (or was that really intended
> "/a-z/i"??)
No, your version would match against any string that contained the 
string "a-z" in it (in upper or lower case).
>  just hides the source of the real error: getting an empty
> value for RBL name.
>   
If I printed the string of @HitList it turned out to have no contents, 
so the scalar of it should have been zero. I have seen the problem of 
"0" not always equaling zero a few other times, hence the addition of 
zero to it to try to fix it, which has normally fixed the problem 
elsewhere. The new modification has only been recently needed, the code 
has worked perfectly well for years (the previous version was very old 
code). If it had been needed before, people would have been complaining 
loudly about this for the past few years, and they haven't been. So if 
the start of the list doesn't contain a letter (all RBL names must 
contain at least 1 letter or they wouldn't work) then the list must 
actually be empty, so I force it to return zero.

> Now finding out where the empty value is coming from, is -- at my
> current understanding of the code -- not yet successful.
>   
Yes. I have another demo of a Perl bug which I'll post for you if you 
like. Perl is not bug-free.

Jules

- -- 
Julian Field MEng CITP
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

MailScanner customisation, or any advanced system administration help?
Contact me at Jules at Jules.FM

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
For all your IT requirements visit www.transtec.co.uk



-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.6.1 (Build 1012)
Charset: UTF-8

wj8DBQFGUbZ+EfZZRxQVtlQRAtNTAJ9GxR/uO9U18R2XYP+0pXP8ZpdvcQCfVfgX
vhTJwQ8OECaV+S2h8XD6pIE=
=93yr
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
For all your IT requirements visit www.transtec.co.uk



More information about the MailScanner mailing list