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

Julian Field MailScanner at ecs.soton.ac.uk
Wed Mar 11 12:18:47 GMT 2009



On 11/3/09 10:10, Drew Marshall wrote:
>
> On 10 Mar 2009, at 23:08, Rick Cooper wrote:
>
>>>> 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};
>>>>    }
>>>>    $b->Done();
>>>>    return;
>>>>  }
>>> Correct.
>>>>
>>>> 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/MailWatch.pm 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 ;-) ).
>>> Oh, how I love working round bugs in Perl :-)
>>> Glad we got there in the end though, and the final code is a
>>> lot simpler
>>> to read than my first version too. I didn't do it this way
>>> initially as
>>> I don't like breaking out of "for" loops with "last", as that is what
>>> the termination condition is for.
>>>
>>> But it works, and that's the most important bit!
>>>
>>> Jules
>>>
>>
>> When/If that is a confirmed fix you might want to apply it to 
>> SMDiskStore.pm
>> as well as it appears to share the same original trackback code
>>
>> Rick
>
> Probably worth lobbing it in a new beta release so more than just 
> little ol' me gets to test it. Certainly from what I have seen in the 
> last 12 hours or so, the code looks good with no problems showing up 
> in any logs.
Good idea.
I have just published 4.75.8.

Jules

-- 
Julian Field MEng CITP CEng
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
PGP public key: http://www.jules.fm/julesfm.asc


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the MailScanner mailing list