in reply to hash reference to itself

Declare the hash before assignment.

my %hash; %hash = ...

Replies are listed 'Best First'.
Re^2: hash reference to itself
by ExReg (Priest) on Aug 02, 2016 at 17:19 UTC

    When my forehead hit the desk, I woke up several people sleeping around me. I don't expect this kind of mental flatulence until Fridays. Thanks! Just what I needed.

      Note that this approach will leak memory unless you do the following when you're done with the hash:
      %hash = ();

        Good to know. Thanks!