in reply to Re: Case insensitivity in a hash... Futile effort?
in thread Case insensitivity in a hash... Futile effort?

Hmm. Well, TMTOWTDI, but I really wouldn't use this if my hash were even slightly large; why use a hash at all if you're going to loop through each key every time you need to do an insert? You'd be better off using a sorted array that you could do a binary search on, or something such.

This is particularly bad if the hash is multi-dimensional. If I wanted to do the equivalent of

$hash{foo}{bar}{baz} = 2;
using your looping method, I'd have to loop over *three* arrays (for the three different keys).

I'm not saying you're wrong--I'm just saying that the tie method is, in most cases, a much better and more general solution.

Replies are listed 'Best First'.
RE: RE: Re: Case insensitivity in a hash... Futile effort?
by ChuckularOne (Prior) on Apr 19, 2000 at 00:13 UTC
    I was going to say I wasn't looping through the hash, but then I went back and looked at the code because I thought... "How could it be working?" And I am. The hash won't be too terribly large for this application maybe 200 records.
    I guess it's time to learn to use tie.

    Your humble servant,
    -Chuck