[San-Diego-pm] Perl Problem

Joel Fentin joel at fentin.com
Mon May 14 15:03:32 PDT 2012


BlueHost upgraded to CentOS 6 and Perl 10. At that moment several 
of my sites there stopped working.
Can't use string ("0") as an ARRAY ref while "strict refs" in use 
at CDsearch.pl line 283.


   my $ref=$dbh->selectall_arrayref("$Select $From $Where $Order 
$Limit");
   my @A=@{$ref};                                #@A=array of refs
   my @B;                                        #@B=array of info 
on 1 CD
   foreach(@{@A})				#error here
   {
     @B=@{$_};
     push(@ID,$B[0]);
     push(@Grupo,$B[1]);
     push(@Disco,$B[2]);
     push(@Vol,$B[3]);
     push(@Ano,$B[4]);
     push(@Cancion,$B[5]);
     push(@Image,$B[6]);
     push(@CancionNo,$B[7]);
   }


Do I need a test for an empty @A?
Or is there something more graceful?

-- 
Joel Fentin       tel: 760-749-8863
Biz Website:      http://fentin.com
Personal Website: http://fentin.com/me


More information about the San-Diego-pm mailing list