Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Confused about complex data structures.

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:

use Data::Dumper; print Dumper(\%city_data);
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}".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://52660]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2023-03-31 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (77 votes). Check out past polls.

    Notices?