|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
undefined value as a HASH reference??by ryddler (Monk) |
| on May 16, 2001 at 13:48 UTC ( [id://80884]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.ryddler has asked for the wisdom of the Perl Monks concerning the following question:
Fellow monks, I seek your wisdom with the following problem. I have created a package with a single sub that I call from the main script. I pass a reference to a hash structure that is built in the main script to the sub when it is called. The hash is built like this: and is passed like this: The error I am receiving is "Can't use an undefined value as a HASH reference at C:/projects/metrosearch//ATGF/PDF/Charges.pm line 47." Here's a snippet of the sub:
As stated in the above snippet, this line:
$Sheet->Range("A6")->{'Value'} = $var_ref->{results}{'Legal'};
is the offending line (as are most of the rest below it if I comment them out one by one).
However, if I were to modify it like so.
It works just fine. I don't understand why these are different in any other way than the style in which they are written. Can anyone shed some light on this for me? TIA ryddler
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||