where the 'xx' is a two-letter city abbreviation and the number is just a six digit ID number. What I then want to do is open the file, and store all the data in a array-of-a-hash-of-a-hash - I think. Honestly, I have a very difficult time with these types of structures. Here is what I am doing:xx_000000
Now, it seems like this should work correctly, but I can't tell if it does. First of all, is my approach correct? Secondly, if so, how would I print out everything that is in the @{$city_data{$city}{$id}} array? I know that this may be a simple question for most, and I have read everything I could find on PM and elsewhere about this subject, but I am still lost. Could someone please try to explain this to me, in detail if you wouldn't mind, so that hopefully the next time I have a problem like this I am not as lost as I am now? Thanks so much to all the gracious helpers out there (and to all who aren't so gracious, thanks anyway :-).my %city_data = (); my ($city, $id) = split(/_/,$filename); open(THIS,"$filename") or die; my @tmp = <THIS>; close(THIS); push @{ $city_data{$city}{$id} }, @tmp;
In reply to Confused about complex data structures. by r.joseph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |