[tpm] Schrodinger's hash ?

Fulko Hew fulko.hew at gmail.com
Fri Jun 22 10:36:06 PDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20120622/d6dabd3b/attachment.html>


More information about the toronto-pm mailing list