<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>I would just change the while loop to:</DIV>
<DIV>foreach (keys %hash) {</DIV>
<DIV>    $index = $_;</DIV>
<DIV>   $object = $hash{$index}</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>It doesn’t explain why your hash appears empty, but if the print work, then 
this code should work just as well.</DIV>
<DIV> </DIV>
<DIV>A while on an array or hash is odd coding, unless you intend to change the 
array inside the loop – but that is an odd thing to do too.</DIV>
<DIV> </DIV>
<DIV>Indy Singh<BR>IndigoSTAR Software -- www.indigostar.com</DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=fulko.hew@gmail.com 
href="mailto:fulko.hew@gmail.com">Fulko Hew</A> </DIV>
<DIV><B>Sent:</B> Friday, June 22, 2012 1:36 PM</DIV>
<DIV><B>To:</B> <A title=toronto-pm@pm.org 
href="mailto:toronto-pm@pm.org">TPM</A> </DIV>
<DIV><B>Subject:</B> [tpm] Schrodinger's hash ?</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none"><FONT 
face="courier new,monospace">I have a mysteriously disappearing 
hash...<BR><BR>If I look at it (in advance) it contains stuff,<BR>but if I just 
'use' it, then its empty... Schrodinger's ghost?<BR><BR><BR>I have the following 
fragment:<BR><BR>    ...<BR>    #print 
"varbindTable num keys: ", scalar keys %varbindTable, 
"\n";<BR>    while (($index, $object) = each %varbindTable) 
{<BR>        ... do loopy stuff 
...<BR>    }<BR><BR>If I enable the print statement and run my 
code, the hash 'contains stuff'.<BR>but if I comment it out, the while loop is 
skipped.<BR><BR>Huh?<BR><BR>(Of course there is a ton more code around this 
fragment<BR>and 'no', I don't have a minimal repeatable example.)<BR><BR>Has 
anyone seen such a behavior?<BR><BR>TIA<BR>Fulko<BR><BR></FONT>
<P>
<HR>
_______________________________________________<BR>toronto-pm mailing 
list<BR>toronto-pm@pm.org<BR>http://mail.pm.org/mailman/listinfo/toronto-pm<BR></DIV></DIV></DIV></BODY></HTML>