in reply to Why does exists cause autovivication?

next LASTLOG unless exists $user_by_uid{$uid}->{$host};

How is perl to know that you don't want to dereference $user_by_uid{$uid} when you dereference it explicitly? Where should exists start dereferencing, and how do you rewrite the evaluation order of expressions to make it work its way through the dereferencing chain without breaking the ability of exists to work on other expressions?

Replies are listed 'Best First'.
Re^2: Why does exists cause autovivication?
by Anonymous Monk on Dec 29, 2007 at 04:18 UTC

    "How is perl to know ..."

    Of course it knows, it is just the language's choice to do so, the whole autovivification thing can be avoided, for the good.

    It is not that perl does not know, the language designer made it to respond that way.

      If you want otherwise you know where to find it. Don't let the door hit you in the tuckus.

      (Anyone else getting a whiff of troll off this anonomonk?)

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        Yes, it clearly is Cop. Apparently it really bothers him that none of us see his posts anymore.