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
Tôi đang sử dụng mô-đun OLE cho Perl và mọi giá trị tôi nhận được từ trang tính và in $ var sau đó tôi nhận được giá trị mong đợi, nhưng khi tôi đặt mọi thứ vào mã băm được in:Dữ liệu của Perl :: Dumper hiển thị các đối tượng thay vì giá trị
'first' => [
bless(do{\(my $o = 15375916)}, 'OLE::Variant'),
bless(do{\(my $o = 15372208)}, 'OLE::Variant'),
Và cứ như vậy. Tôi không hiểu gì về băm, bởi vì tôi thực sự bối rối ở đây.
Tôi nghĩ nó đơn giản như thế. Cảm ơn! – Melissa