Re: hash table



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

.



Relevant Pages

  • Re: try this quiz
    ... I'm okay with the username. ... is in the nature of spam, of course, that there will be many ways (i.e. ... more than one) to get from SPAM and EMAIL to LAMER. ...
    (rec.puzzles)
  • Re: try this quiz
    ... I'm okay with the username. ... is in the nature of spam, of course, that there will be many ways (i.e. ... more than one) to get from SPAM and EMAIL to LAMER. ...
    (rec.puzzles)
  • Re: try this quiz
    ... I'm okay with the username. ... is in the nature of spam, of course, that there will be many ways (i.e. ... more than one) to get from SPAM and EMAIL to LAMER. ...
    (rec.puzzles)
  • Re: SSH sftp and Windows
    ... were samba gets your username and workgroup from. ... I expect that to be okay. ...
    (comp.os.linux.security)
  • Re: IIS says "You are not authorized to view this page". Grrrr.
    ... > Nate Bargmann wrote: ... Why not just enter your username and password? ... Okay, dumb question, where do I enter this, in the dialog or in the URL ... Amateur radio exams; ham radio; Linux info @ | free since January 1998. ...
    (Debian-User)