in reply to Anonymous or normal hashes?

in your example is no difference, the big difference is if you pass the hashes around ie:
my_sub(%hash); # slow for big hashes my_other_sub($hashref); # fast
Boris

Replies are listed 'Best First'.
Re: Anonymous or normal hashes?
by Abigail-II (Bishop) on Jan 09, 2004 at 14:43 UTC
    But that has nothing to do with anonymous vs. non-anonymous hashes.
    my_sub (%{ ... }) # Slow for big anonymous hashes. my_other_sub (\%hash) # Fast for non-anonymous hashes.

    Abigail

      I'm curious. How about situation where you have prototyped a subroutine eq. sub my_add (\%@) {} what then requires a % in call instead or \% of $hash_ref? Does that change the speed of the call?
        If it requires a %, then neither \% nor $ref are even options. So, what do you want to compare in that case?

        Abigail

      But that has nothing to do with anonymous vs. non-anonymous hashes.
      Yes, as I wrote. There is no difference in your example.
      Boris