in reply to lazy creation of a hash

Do you actually need to distinguish the empty hash from an "undefined" state? If not, just use a scalar truth test, which returns only false if the hash is empty.

Replies are listed 'Best First'.
Re^2: lazy creation of a hash
by John M. Dlugosz (Monsignor) on May 12, 2011 at 12:36 UTC
    Yes, in this case I can be sure that the populated hash is not empty.

    I suppose that should be fast/efficient if done in boolean context.