Interesting Error - Can't use string ("1909") as an ARRAY
refwhile "strict refs" in use
Rick Cooper
rcooper at dwford.com
Tue Mar 10 16:13:50 GMT 2009
> -----Original Message-----
> From: mailscanner-bounces at lists.mailscanner.info
> [mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf
> Of Drew Marshall
> Sent: Tuesday, March 10, 2009 11:24 AM
> To: MailScanner discussion
> Subject: Re: Interesting Error - Can't use string ("1909") as
> an ARRAY refwhile "strict refs" in use
>
>
> On 10 Mar 2009, at 15:00, Julian Field wrote:
>
> > You'll probably need a quick
> > my $i;
> > before that code. So the final version looks like this:
> >
> > 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;
> > }
>
> And that generates:
>
> MailScanner --debug
> In Debugging mode, not forking...
> Trying to setlogsock(unix)
> Building a message batch to scan...
> Have a batch of 10 messages.
> max message size is '250000 trackback'
> max message size is '250000 trackback'
> max message size is '250000 trackback'
> max message size is '250000 trackback'
> max message size is '250000 trackback'
> max message size is '250000 trackback'
> max message size is '250000 trackback'
> max message size is '250000 trackback'
> commit ineffective with AutoCommit enabled at /etc/MailScanner/
> CustomFunctions/MailWatch.pm line 94, <CLIENT> line 404.
> Stopping now as you are debugging me.
>
> Which is exactly what it should! :-)
>
> Excellent, well done. That code is now in production so I'll
> beta test
> the life out of it but I'm sure it will be fine.
>
> Thanks Jules, great job as ever.
>
The $i++ is wrong, it should be $i--
Rick
--
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