in reply to Anonymous or normal hashes?

There is no difference between a "hash reference" and a "hash" in terms of performance. In simple terms, internally a "hash" is just a "name" (global or lexical) with a "hash reference" attached to it internally.

And you don't need a hash reference to pass hashes quickly to subroutines: you can generate references to hashes "on the fly":

foo( \%hash ); # hashref created "on the fly" by taking ref of hash foo( $hashref ); # use hash reference stored in a scalar
Both become the same type of hash reference inside  sub foo.

Hope this helps.

Liz

Replies are listed 'Best First'.
Re: Re: Anonymous or normal hashes?
by ysth (Canon) on Jan 09, 2004 at 18:02 UTC
    There is going to be a very slight time difference between $hash{foo} and $hashref->{foo}, since the latter takes one additional operation (assuming both are lexicals). But any difference is likely to be trivial enough that it should be a matter of preference.