in reply to Re^2: Hash assignment: Undocumented feature?
in thread Hash assignment: Undocumented feature?
Perhaps you're new enough to the concept of a hash to not fully understand that any hash "bucket" acts the same as an array "bucket". In other words,
$hash{'bucket'} = 'something';
is similar in concept to
$array[5]='something';
If you then, say
$array[5]='something else';
hopefully you understand that $array[5] has been written over with the new information; just extend that concept to
$hash{'bucket'} = 'something else';
$hash{'bucket'} = 'something';
is similar in concept to
$array[5]='something';
If you then, say
$array[5]='something else';
hopefully you understand that $array[5] has been written over with the new information; just extend that concept to
$hash{'bucket'} = 'something else';
So, no this is not new behavior, but the way hashes, across all the languages that implement some sort of hash, are supposed to work.
-Scott
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Hash assignment: Undocumented feature?
by fsavigny (Novice) on Aug 11, 2013 at 17:54 UTC | |
Re^4: Hash assignment: Undocumented feature?
by ikegami (Patriarch) on Aug 12, 2013 at 19:38 UTC |
In Section
Seekers of Perl Wisdom