, Spreadsheet:: Read perl module, , , 1- . $workbook, , . , "csv", "xls". , , , :
http://search.cpan.org/~hmbrand/Spreadsheet-Read/Read.pm
use Spreadsheet::Read;
sub print_xlsx_file{
my $file_path = shift;
my $workbook = ReadData($file_path,cells => 0 );
if(defined $workbook->[0]{'error'}){
print "Error occurred while processing $file_path:".
$workbook->[0]{'error'}."\n";
exit(-1);
}
my $worksheet = $workbook->[1];
my $max_rows = $worksheet->{'maxrow'};
my $max_cols = $worksheet->{'maxcol'};
for my $row_num (1..($max_rows))
{
for my $col_num (1..($max_cols)){
print $worksheet->{'cell'}[$col_num][$row_num]."\n";
}
}
}
source
share