so, i'm thinking i'm not understanding references here again, but here's
what i have.

i fill in my array here:
my $worksheetin = $workbookin->worksheet(0);

my ( $row_min, $row_max ) = $worksheetin->row_range();
my ( $col_min, $col_max ) = $worksheetin->col_range();

for my $row ( $row_min .. $row_max ) {
   for my $col ( $col_min .. $col_max ) {

      my $cell = $worksheetin->get_cell( $row, $col );
      next unless $cell;

      $xldata[ $row ][ $col ] = $cell->unformatted() ;
   }
}

and, i save it here (all works fine at this point):

my $worksheetout = $workbookout->add_worksheet( 'Data' );
$worksheetout->write_col( 0, 0, \...@xldata );

but, then i go and try to do an query with data in an element of the array,
and it fails. well, the array appears empty:

while ($year <= $yearnow) {
   my $count = 0;
   my $worksheetout = $workbookout->add_worksheet( '$year' );

   for my $row ( 0 .. $#xldata ) {
      print "@{ $xldata[ $row ] }\n";
      print "MMSI: $xldata[ $row ][ 13 ]\t YEAR: $year\n";
      $sth->execute( $xldata[ $row ][ 13 ], $year );

      while (my $sqldata = $sth->fetchrow_arrayref) {
         $worksheetout->write_row( $count++, 0, \...@{ $sqldata } );

      }
   }
   $year++;
}

Reply via email to