From: dan donaldson Date: 2006-06-20T06:38:54+09:00 Subject: Re: associative array naming indirection Matthew Smillie wrote: > On Jun 19, 2006, at 20:51, dan donaldson wrote: > >> 'city_prov', 'addr'] >> >> obviously, some giant conceptual leap needs to be made, or its a >> miniscule typo. (methinks the former) > > It's the typos, I'm afraid. First, you've got an unterminated string > literal on 'district'. Ah yes. The typo was in fact introduced during the editing of the copy/pasted text which contained a prefix that revealed the client's name. But it was in fact the '=>' operator. Thanks for pointing that out. Thanks also to everyone else, and esp. to Daniel, I'll absorb what you wrote as well. A one line solution, that's elegance. I imagine that if there's a problem with the two arrays being of different lengths, I could truncate the longer one. Related: The reason for futzing with .upto() was to deal with a variable length of input array needing to access labels in a given order. Is there a better way? Working now. First post to the Ruby community: nice responses. I think I may like this. -- Posted via http://www.ruby-forum.com/.