If I understand correctly what you are trying to do can't be done with "normal" hashes. Normally a hash can contain only one value for each unique key, and therefore you overwrite the value each time you assign a value to a particular key. So you have two obvious options (in other words that I can come up with right now), you can tack on a unique identifier to the key: 'Akorn Drive Part 1','Akorn Drive Part 2' for instance, which is ugly and tedious, or you can use a hash of arrays, where you store a reference to an anonymous array as the value of the hash key, and then push each of the values to the array contained therein. There may also be a module that does this sort of thing, but I am unaware of it off the top of my head.
perldoc perlreftut perldoc perlref http://danconia.org ------------------------------------------------ On Mon, 2 Dec 2002 06:38:31 -0800 (PST), Ben Crane <[EMAIL PROTECTED]> wrote: > Hi, > > a slight change to the previous mail: if I've got a > key (e.g. A, and I have 3 or 4 keys (which are all A) > which correspond to different data... > > e.g. Acorn Drive is a key, but there are several parts > the make up Acorn Drive...I want a key (Acorn drive) > to be able to refer to EVERY part of it... > > so If I've got a hash, that looks like: > > Acorn Drive => A > Acorn Drive => B > etc... > > surely, if I match one key (Acorn Drive), it'll make > multiple matches through the hash?? at the moment, I > enter a key, and it only returns one record...have a > missed the point completely?? > > how do I make multiple matches within a hash with one > key only? > > Ben > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]