in reply to Re: dealing with arrays as hash values
in thread dealing with arrays as hash values
I had some other stuff in that if statement that needed to be done too. but now when I print out the values from %wo_usr_proj, I only get array memory addresses:push @{$wo_usr_proj{$project}}, $user;
That gave me the array memory adresses as output into my file I then tried:foreach $proj(sort(keys(%wo_usr_proj))) { print RHANDLE "$proj:\n"; foreach $element(sort($wo_usr_proj{$proj})) { print RHANDLE "$element\n"; } print RHANDLE "\n\n"; }
thinking that by derefencing $element it would give me the value, but instead it gave me scaler memory adresses. I don't think that the user names are actually getting put into the hash. Is there some initialization that needs to occur to "tell" the hash that its value is an array? I think if I get past this last part I'll be done. Thank you in advance for any help or comments on my code.foreach $proj(sort(keys(%wo_usr_proj))) { print RHANDLE "$proj:\n"; foreach $element(sort($wo_usr_proj{$proj})) { print RHANDLE \$element; print RHANDLE "\n"; } print RHANDLE "\n\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: dealing with arrays as hash values
by sacked (Hermit) on May 17, 2004 at 22:46 UTC |