foreach my $row (1..$end)
{
foreach my $col (3..27 )
{
# skip empty cells
next unless defined
$worksheet->Cells($row,$col)->{'Value'};
# print out the contents of a cell
$var = $worksheet->Cells($row,$col)->{'Value'};
push @dates, $var;
print $var; #this prints the value just fine
}
}
my %hash;
$hash{'first'} = \@dates;
print Dumper \%hash; #This prints object information
我正在使用用于 Perl 的模块 OLE 以及从工作表中获得的每个值并打印 $var 然后我得到预期值,但是当我将所有内容放入哈希中时,它会打印:
'first' => [
bless( do{\(my $o = 15375916)}, 'OLE::Variant'),
bless( do{\(my $o = 15372208)}, 'OLE::Variant'),
等等。我一定不了解哈希,因为我真的很难过。