in reply to hash me a few variables

Is there some reason that you have comment characters in the code where you define your hash? This may be part of the problem. $keyhash{$id}{MANY} doesn't exist!
$keyhash{$id} = { NAME => $name, REF => $ref#, <--- HERE? #MANY => [], <--- AND HERE? };
buckaduck

Replies are listed 'Best First'.
Re: Re: hash me a few variables
by Anonymous Monk on Mar 20, 2001 at 04:20 UTC
    I forgot to remove them after I was testing some other code. Thanks for reminding me.
      But removing the comments didn't help nor did adding $keyhash->{NAME},
      I'm confused.
        Upon further reflection, your code shouldn't break even if that line had been deleted. It just looks wrong. My bad.

        At this point it might help if we saw @data and @data2. I have a sneaking suspicion that your program is actually behaving correctly.

        In the meantime, you wanted to know how to access $name and $ref? As near as I can tell, for each entry $n < $num you can use these:

        $keyhash{$id}{MANY}[$n][0] # $name $keyhash{$id}{MANY}[$n][1] # $ref
        Maybe this will help you debug your very very strange data structure...

        buckaduck