in reply to Re^2: hash refferences
in thread hash refferences

push @array, { %temp };

That actually copies the items from %temp into an anonymous hash, and returns its reference.

See perlreftut and perlref for more details.

Replies are listed 'Best First'.
Re^4: hash refferences
by leonidlm (Pilgrim) on Aug 21, 2008 at 13:15 UTC
    Heh thanks, this is exactly what I did, but somehow it seems not efficient enough.
    What about the following solution:
    Substitute the %temp variable by $tempRef= {} ?
      Yes, you can do that. That way you avoid the copy, and whenever you need a fresh hash you can write $tempRef = {}.