http://www.perlmonks.org?node_id=80911


in reply to Re: Re: undefined value as a HASH reference??
in thread undefined value as a HASH reference??

Is it possible that the Range("A6") call is returning undef? Hoewver, that does not explain why it works after you assign it to a scalar. Perhaps the thing returned by Range() is a tied hash? Can you print out the result of the following:

my $range = $Sheet->Range("A6"); print STDERR "Ref: ", ref($range), "\n"; print STDERR "Tied: ", tied($range), "\n";

-ben

Replies are listed 'Best First'.
Re: Re: Re: Re: undefined value as a HASH reference??
by ryddler (Monk) on May 16, 2001 at 19:19 UTC
    I did you one better and added print STDERR "Range:  $range\n"; into the mix. Here's the output:
    Range: Win32::OLE=HASH(0x245b554) Ref: Win32::OLE Tied:

    Update: Further investigation shows that wrapping an eval around the hash like so:

    $Sheet->Range("A6")->{'Value'} = eval { $var_ref->{results}{'Legal'} +};
    Also executes without error.

    ryddler