in reply to hash, a troublemaker?
BTW, if you do use constants, an array is more efficient unless only a sparse set of keys are ever used at once:
The difficulty in making hashes "strict" is just one of the reasons why many people dislike blessed-hashref object implementations.use constant { K_AGE => 0, K_NAME => 1 }; my @record; $record[K_AGE] = 1001; $record[K_NAME] = 'Doraemon';
Update: See also: non-autovivifing hash, how to avoid mis-spelling hash keys?.
blokhead
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re(2): hash, a troublemaker?
by bart (Canon) on May 12, 2004 at 08:50 UTC | |
|
Re: Re: hash, a troublemaker?
by Doraemon (Beadle) on May 12, 2004 at 06:23 UTC |