Actually, because you are using hash references, you need to use something like '%{$repeats{$k1}}' rather than '%repeats{$k1}':
foreach $k1 (keys %repeats){ foreach $k2 (keys %{$repeats{$k1}}) { foreach $k3( keys %{$repeats{$k1}{$k2}}){ if ($repeats{$k1}{$k2}{$k3} == 1){ print "I got it\n"; } } } } ---Larry >Hi!! >I have a CGI that updated a mysql database, I have a nested hash >structure in it. >something like >$repeats{$solID[i]}{$expId[i]}{$elemenet[$i]}=1 > >If I am to check this hash is the inner loop written as > foreach $k1 (keys %repeats){ > foreach $k2 (keys %repeats{$k1}) { > foreach $k3( keys %repeats{$k1}{$k2}){ > if ($repeats{$k1}{$k2}{$k3} >==1){ > print "I got it\n"; > } > } > } > } > >Is this correct ?? >Thanks and Cheers always!! >Murli +------------------------------------------------------------------------+ | Larry Coffin, G.P.H. Watertown, MA | | http://www.PointInfinity.com/lcoffin/ [EMAIL PROTECTED] | +------------------------------------------------------------------------+ Of course there's no reason for it, it's just our policy. - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]