![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Confused about complex data structures.by saucepan (Scribe) |
on Jan 18, 2001 at 05:13 UTC ( #52660=note: print w/replies, xml ) | Need Help?? |
Your code appears to do what you think it does. Whether
this is best approach or not depends on what you are
going to do with the structure once it's in memory. The
layout you've selected is great if you'll often
need to work with all the records for a particular city,
for example. To see what your data structure looks like, you can use Data::Dumper to inspect the structure after you've built it:
or use the perl debugger (which I can't help you with, being of the printf() school of debugging, myself). :) As for printing everything in one of your arrays, you've already got this licked: print @{ $city_data{$city}{$id} } will output the content of the file "${city}_${id}".
In Section
Seekers of Perl Wisdom
|
|