Take the 2-minute tour ×  When I extract text from an excel file
it comes as Win32::OLE::Variant=SCALAR(0x1214f94). How do I
convert this to a Perl variable? When I try to use the value
function is just prints @data = @{$dataHash{$header}};  my
($refs,$rows,$header) = &extract;  my %dataHash = %{$refs};
print "Keys:",keys %dataHash,"\n"; my @headers =  @{$header};
my @test = @{$dataHash{'Date'}};  foreach my $scalar (@test){
print $scalar;  foreach my $header (@headers){     print
"Checking Header: $header\n";       print $data;     foreach my
$scalar (@data){         print FH "$scalar\n";   All I needed to
do was enter use Win32::OLE::Variant and
Win32::OLE::Variant=SCALAR(0x1214f94) became a readable answer.
share|improve this question  2 Answers 2  As a general rule,
when you get a value such as SCALAR(0x1214f94), you are printing
a reference/address, not a value. You can dereference by adding
a dollar sign in front of the variable:  $a = \$b; $b = 1; print
$a;   # prints something like SCALAR(0x1214