Re: hash table
- From: "Manish" <marora@xxxxxxxxx>
- Date: 21 Mar 2007 14:31:14 -0700
On Mar 21, 3:32 pm, vincent.ribe...@xxxxxxxxx wrote:
Greeting,
I'm not sure about this hence my question:
If i do:
my %username =();
$username{'Simpson'}='Bart';
okay
$username{'Simpson'}='Homer';
okay
print @username{'Simpson'}; # will return the last entry (Homer). I
You meant print $username{'Simpson'};
thought i would get a list with both entries....
Why do you think you should get a list?
If you go back and see what you have written:
1. $username{'Simpson'}='Bart';
2. $username{'Simpson'}='Homer';
By doing the above two steps you are overwriting the contents stored
during iteration '1'.
Thanks in advance for your help.
Vince
.
- References:
- hash table
- From: vincent . ribeaud
- hash table
- Prev by Date: hash table
- Next by Date: perl -e equivalent of short script...
- Previous by thread: hash table
- Next by thread: Re: hash table
- Index(es):
Relevant Pages
|
|