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

Rick Cooper rcooper at dwford.com
Mon Mar 9 13:52:33 GMT 2009


 

 > -----Original Message-----
 > From: mailscanner-bounces at lists.mailscanner.info 
 > [mailto:mailscanner-bounces at lists.mailscanner.info] On 
 > Behalf Of Julian Field
 > Sent: Sunday, March 08, 2009 11:35 AM
 > To: MailScanner discussion
 > Subject: Re: Interesting Error - Can't use string ("1909") 
 > as an ARRAY ref while "strict refs" in use
 > 
 > 
 > 
 > On 3/8/09 3:25 PM, Drew Marshall wrote:
 > > ----- "Julian Field"<MailScanner at ecs.soton.ac.uk>  wrote:
 > >
 > >    
 > >> Okay, try changing your line 509 to say this instead:
 > >> while(${@{$body}}[$#{@$body}] !~ /^\s*$/) {
 > >> That does at least compile ( sorry about that :-(
 > >>      
 > > No worries. You are right it does compile but..
 > >
 > > MailScanner --debug
 > > In Debugging mode, not forking...
 > > Trying to setlogsock(unix)
 > > Building a message batch to scan...
 > > Have a batch of 5 messages.
 > > max message size is '250000 trackback'
 > > Can't use string ("76") as an ARRAY ref while "strict 
 > refs" in use at 
 > /usr/share/MailScanner//MailScanner/PFDiskStore.pm line 509.
 > >    
 > How about this then? (He says, desperately trying to work 
 > around a nast 
 > bug in Perl 5.10)
 > 
 > my $bodysize = $#{@$body}+0;
 > while (${@{$body}}[$bodysize+0] !~ /^\s*@/) {
 > 
 > If that doesn't work either, I give up.
 > 
 > Jules
 > 
 And if that doesn't work wouldn't this do the same thing?

my @bodycheck = @{$body};

for ($i=(@bodycheck-1);$i >= 0; $i--){
	last if @bodycheck[$i] =~ /^\s*$/;
	print "Line is ****". at bodycheck[$i]."****\n";
	pop @{$body};
}

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