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

Drew Marshall drew.marshall at trunknetworks.com
Sat Mar 7 17:07:18 GMT 2009


Rick

On 7 Mar 2009, at 16:30, Rick Cooper wrote:

> Been looking at this and really have no way to test because I don't  
> use
> postfix but try changing
>
>    while (${@{$body}}[scalar(@{$body})-1] !~ /^\s*$/) {
>      print "Line is ****" . ${@{$body}}[scalar(@{$body})-1] . "**** 
> \n";
>      pop @{$body};
>      #print STDERR ".";
>    }
>
> TO
>
>    my $Bodyref = \@body;
>
>    while (${@{$body}}[$#Bodyref] !~ /^\s*$/) {
>      print "Line is ****" . ${@{$body}}[$Bodyref] . "****\n";
>      pop @{$#Bodyref};
>      #print STDERR ".";
>    }

Note # removed.

This produces:

Global symbol "@body" requires explicit package name at /usr/share/ 
MailScanner//MailScanner/PFDiskStore.pm line 509.
Global symbol "@Bodyref" requires explicit package name at /usr/share/ 
MailScanner//MailScanner/PFDiskStore.pm line 512.
Global symbol "@Bodyref" requires explicit package name at /usr/share/ 
MailScanner//MailScanner/PFDiskStore.pm line 513.
Compilation failed in require at /usr/sbin/MailScanner line 354.


Drew


More information about the MailScanner mailing list