$Interfaces::ExcelBinary::Headers = []; # cell_handler (Workbook, Sheet_index, Row, Col, Cell) # Called by Spreadsheet::ParseExcel for every cell encountered. sub cell_handler { my ($workbook, $sheet_index, $row, $col, $cell) = @_; if ($row == 0) { push(@{$Interfaces::ExcelBinary::Headers}, $cell->value); } if ($row > 0) { Data::Dump::dd($Interfaces::ExcelBinary::Headers); $workbook->ParseAbort(1); exit; } } # ReadData (Filename, [WorkSheetID]) returns $ar_data # Reads data from the given file (which should be a BIFF-formatted .xls-file) and the given worksheet (by name or number (0-based)). # If the supplied worksheetID is a number, a negative number -n will refer to the n-to-last worksheet. sub ReadData { my ($self, $FileName, $WorkSheetID) = @_; my $ExcelParser = Spreadsheet::ParseExcel->new( CellHandler => \&cell_handler, NotSetCell => 1, ); print("Parsing\n"); my $WorkBook = $ExcelParser->parse($FileName); print("Done parsing\n"); exit;