in reply to Re: Re: hash key lookups failing
in thread hash key lookups failing
exists has no "limitations". If it's in the hash, it can find it. I would rather guess you're passing it something you think looks right, which isn't; so exists() goes looking either for something other than you mean to tell it to, or in some place you didn't mean to tell it to - or both.
You quite certainly don't want to write $vals=@keys[0];, it is $vals=$keys[0]; since the value you're getting back is a single scalar. $scalar = @array[0]; only works due to a mere coincidence in the language setup. Judging from so little evidence I can't be sure of course, but I suspect you come from a tranditional language and haven't yet fully understood the notion of scalar/list context; if so, you should realy work on that since otherwise you're likely to make a lot of mistakes with what will look like positively bizarre effects.
But maybe we can clear up both points if you can paste some more of your code :)