[tpm] Schrodinger's hash ?

Mike Stok mike at stok.ca
Fri Jun 22 11:07:46 PDT 2012


Have you been iterating over the hash before the keys in the print resets the iterator?  Maybe the iterator was all but done.

Mike

On 2012-06-22, at 1:36 PM, Fulko Hew wrote:

> I have a mysteriously disappearing hash...
> 
> If I look at it (in advance) it contains stuff,
> but if I just 'use' it, then its empty... Schrodinger's ghost?
> 
> 
> I have the following fragment:
> 
>     ...
>     #print "varbindTable num keys: ", scalar keys %varbindTable, "\n";
>     while (($index, $object) = each %varbindTable) {
>         ... do loopy stuff ...
>     }
> 
> If I enable the print statement and run my code, the hash 'contains stuff'.
> but if I comment it out, the while loop is skipped.
> 
> Huh?
> 
> (Of course there is a ton more code around this fragment
> and 'no', I don't have a minimal repeatable example.)
> 
> Has anyone seen such a behavior?
> 
> TIA
> Fulko
> 
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm

-- 

Mike Stok <mike at stok.ca>
http://www.stok.ca/~mike/

The "`Stok' disclaimers" apply.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20120622/61550def/attachment.html>


More information about the toronto-pm mailing list