For that to work right, you need to not be pushing %hash onto @array (that will flatten hash into a list) but rather push @array, {%hash}; (push an anonymous hash reference).foreach $date ( @weather_days ) { $weather_archive{$date->{Year}}{$date->{Month}}{$date->{Day}} = ( $date->{High}, $date->{Low}, $date->{Season}, $date->{Wind}, $date->{Bar} ); }
I'm sure that my snippet can be done with a map too but this is good enough. Oh, and that's the part that perlreftut would give you a better grasp on. Go ahead and read perlreftut and perlref as mentioned earlier so that you won't flunk the exam at the end of the semester. Producing working code today, and understanding the concepts behind it are two different things. This is something that you will use a lot once you understand the concepts. Failing to dig until the concept sinks in is going to cripple your progress.
Dave
In reply to Re: Re: Re: Re: Re: 3D array of hashes
by davido
in thread 3D array of hashes
by ManyCrows
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |