Allan Greenier <agreenier@snet.net> wrote: >OK of course everyone's suggestions for using a hash is the perfect one >for my project >The vendor and family lists are born to be hashes. Yes. >So is this syntax correct: >for each $model keys(%Models) >($vendor,$family,$modelhtml) = $model > >or is it >for each @model keys(%Models) >($vendor,$family,$modelhtml) = @model Neither will get you what you want. When you use keys(%Models), what it returns is the _keys_, not the _values_ of the hash, so the generic form of what you have above is: foreach $hash_key keys(%Models) { ($hash_value) = $Models{$hash_key} #do things to this $hash_value } But I want to question your current assumption that you need to use anonymous list references in your hash values. Anonymous refs are a very handy feature, but I'm not sure you need them (and if you do use them, remember to study up on DE-referencing). I don't have the previous discussion on this thread in the machine I'm using at the moment, so I don't remember your exact data structure (I remember a mix of tabs and commas, which it sounds like you've recognized is unnecessarily complex). But my suggestions would be: 1. get your chops down with lists (arrays) and hashes, 2. re-read the messages that recommended the use of the map() function, one of the most powerful tools in Perl for deconstructing lists. In this regard, notice that you got three responses that all used variants of the "Schwartzian Transform." This is well worth studying until it makes sense. The ST is one of those things that we perlistas like to brag about ("it would have taken 100 lines of code in any other language..." ;-) Good luck! - Bruce # ~~~~~~~~~~~~~~~~~~~ # Bruce Van Allen # bva@cruzio.com # ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Director # WireService, an Internet service bureau # Serving the educational and nonprofit sectors # wire@wireservice.org # http://wireservice.org # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===== Want to unsubscribe from this list? ===== Send mail with body "unsubscribe" to macperl-request@macperl.org