Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I believe he is saying that this is more efficient to be passed to a subroutine, and I agree with that.$student = {}; $student->{last} = 'Smith';
I have also heard that it is faster to create and use a hash reference in general than using a "regular" hash such as:&sub(\%hash, \@array);
This might be a silly question but is it more efficient to declare and uses hashes that way (reference) and if it is more efficient then why do we have the possibility to declare and use them the "regular" way?my %student = {}; $student{'last'} = 'Smith';
Confused Monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hashes and hash references
by pg (Canon) on Sep 04, 2005 at 17:39 UTC | |
by GrandFather (Saint) on Sep 04, 2005 at 19:09 UTC | |
|
Re: Hashes and hash references
by dave_the_m (Monsignor) on Sep 04, 2005 at 17:17 UTC | |
by Anonymous Monk on Sep 04, 2005 at 21:11 UTC |