oakley has asked for the wisdom of the Perl Monks concerning the following question:
The problem exists when I try to get the value from key2 into the subroutine being called *IN* key3. It tells me "Global symbol "%HoH" requires explicit package name ... ". The hash has been declared, but I am basically calling it from within itself - is this not possible? If it is, what am I doing wrong?my %HoH = ( yadda1 => { key1 => "value1", key2 => &GetValue, # returns date string key3 => &Compare($var1,$HoH{yadda1}{key2}), }, yadda2 => { key1 => "value1", key2 => &GetValue, # returns date string key3 => &Compare($var1,$HoH{yadda2}{key2}), }, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re-using a hash value in same hash?
by merlyn (Sage) on Mar 06, 2001 at 00:15 UTC | |
|
Re: Re-using a hash value in same hash?
by chipmunk (Parson) on Mar 06, 2001 at 00:24 UTC | |
|
(tye)Re: Re-using a hash value in same hash?
by tye (Sage) on Mar 06, 2001 at 00:20 UTC | |
|
Re: Re-using a hash value in same hash?
by boo_radley (Parson) on Mar 06, 2001 at 00:22 UTC |