in reply to Re: Hashes and boolean values
in thread Hashes and boolean values

wouldn't that just autovivify it and then burn me later?

Replies are listed 'Best First'.
Re^3: Hashes and boolean values
by moritz (Cardinal) on Jan 23, 2012 at 13:26 UTC

    I don't understand, I thought you wanted to set a default. Now you are afraid that setting a default will burn you?

    I am trying to set a hash to a default boolean value unless the hash key exists. Here's an example:

    That's exactly what my code does.

      Don't mind me, I was just having a case of the "Mondays".

      Thanks regardless.

Re^3: Hashes and boolean values
by JavaFan (Canon) on Jan 23, 2012 at 14:12 UTC
    I cannot answer whether you will burn later, but exists $hash{foo} will not autovivify $hash{foo}. Now, exists $hash{foo}{bar} will autovivify $hash{foo}, but then, so will EXPR if $hash{foo}{bar}.