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
Run Code Online (Sandbox Code Playgroud)
我使用模块OLE for Perl和我从工作表中获得的每个值并打印$ var然后我得到了预期的值,但是当我把所有内容放入哈希时它打印:
'first' => [
bless( do{\(my $o = 15375916)}, 'OLE::Variant'),
bless( do{\(my $o = 15372208)}, 'OLE::Variant'),
Run Code Online (Sandbox Code Playgroud)
等等.我一定不明白哈希的事情,因为我真的很难过.