我是 perl 新手,并且在使用电子表格 excel 解析器模块时遇到了问题。
当我在自己的行上使用 $cell->value() 时,似乎没有问题,但是当我尝试使用它将值插入数组时,它返回 undef,代码如下所示:
for my $row ($row_min .. $row_max) {
my @line;
for my $col ( $col_min .. $col_max) {
my $cell = $worksheet->get_cell( $row, $col );
$value = $cell->value;
push @line, $value if defined($cell);
print $cell->value;
print Dumper $line;
}
}
}
这里打印 $cell->value; 返回单元格的内容但打印 Dumper $line; 返回 undef