Hello -- On Mon, 15 Apr 2002, Martin DeMello wrote: > Alex Liebowitz <stopm / attbi.com> wrote: > > Is there any way to specify a value and hash, and get the key corresponding > > to that value (in O(1) time, preferably)? > > How would this work in the case of more than one key having the same value? Hash#index seems to follow the default order of the keys (as returned by #keys)... so it's probably best (if you're using Hash#index) to regard it as undefined. David -- David Alan Black home: dblack / candle.superlink.net work: blackdav / shu.edu Web: http://pirate.shu.edu/~blackdav