Interesting Error - Can't use string ("1909") as an ARRAY ref while "strict refs" in use

Drew Marshall drew.marshall at
Tue Mar 10 18:58:10 GMT 2009

On 10 Mar 2009, at 17:55, Julian Field wrote:
>> Julian, I believe you want for ($i=(@{$body}-1); $i>=0; $i--)  
>> { #decrement
>> not increment
> Of course I do, well done for spotting the intentional error, just  
> making sure you guys are kept on your toes ;-)

Ok, so I now have (For the purposes of the record):

if ($configwords[1] =~ /tr[ua]/i) {
     my $i;
     for ($i=(@{$body}-1); $i>=0; $i--) {
       last if $body->[$i] =~ /^\s*$/i;
       pop @{$body};

Which still works:

MailScanner --debug
In Debugging mode, not forking...
Trying to setlogsock(unix)
Building a message batch to scan...
Have a batch of 1 message.
max message size is '250000 trackback'
commit ineffective with AutoCommit enabled at /etc/MailScanner/ 
CustomFunctions/ line 94, <CLIENT> line 61.
Stopping now as you are debugging me.

Still in production so tomorrow will give it a true test of a few '000  
messages but I'm more than sure it will be fine (But then I said that  
last time ;-) ).


More information about the MailScanner mailing list