foreach $i(0..$#{$rows}) { foreach $j (0..$#{$rows->[$i]} ) { $rows->[$i][$j]; } } #### while ($i<=2) { my $placeholder = ":p_$j"; print "$placeholder\n"; my $rd = "$rows->[$i][0]"; print "$rd\n"; ################################ # # create a new EXCEL instance # ################################ my $Excelfile = "Q4 $rd PERFORMANCE RPT.xls"; my $excel = Spreadsheet::WriteExcel::Big->new("$Excelfile"); my $worksheet = $excel->addworksheet("Q4_STORE"); ########Create Subroutine to Select Data and insert into Worksheet#### +#### sub get_store_data { #### ############################ # # Prepare Query # ############################ my $sth = $dbh->prepare($stmt);