Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I know that where efficiency is concerned it is better to pass references instead of hashes or arrays. My question is about the following code:
Does the assignment in the last line of code populate the hash (thus eliminating any benefits gained from using the hashref)? I know that I can use $$hashref{$_} or other forms of dereferencing but I'd prefer to use %hash if it's not too costly. Thanks.use strict; use warnings; use mylib; my $hashref = mylib::load_hash('big.file'); my %hash = %{$hashref};
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Hash references and efficiency
by jsprat (Curate) on Aug 03, 2002 at 04:41 UTC | |
by simeon2000 (Monk) on Aug 03, 2002 at 13:26 UTC | |
by perrin (Chancellor) on Aug 03, 2002 at 18:18 UTC | |
Re: Hash references and efficiency
by Cine (Friar) on Aug 03, 2002 at 09:21 UTC | |
by perrin (Chancellor) on Aug 03, 2002 at 18:16 UTC | |
Re: Hash references and efficiency
by jlongino (Parson) on Aug 08, 2002 at 16:43 UTC |
Back to
Seekers of Perl Wisdom