N00b question, sorry... I'm porting some Perl code to Java, and I came across code like this:
$d['A3'] = 63.6;
$d['B1'] = 34.6;
$d['C4'] = 7.2;
$d['B'] = 49.2;
My first assumption was that this is something like a hashtable or associative array, where the value (for instance) of $d['C4'] is 7.2. However, any time I try to run the Perl script and print the value of any item in the array based on what I thought was the "key" ('C4'), I always get the value of the last item listed - in the case above, everything returns 49.2.
Can anyone explain this construct? I've searched online and found nothing.
Thanks in advance for any help!
H100
$d['A3'] = 63.6;
$d['B1'] = 34.6;
$d['C4'] = 7.2;
$d['B'] = 49.2;
My first assumption was that this is something like a hashtable or associative array, where the value (for instance) of $d['C4'] is 7.2. However, any time I try to run the Perl script and print the value of any item in the array based on what I thought was the "key" ('C4'), I always get the value of the last item listed - in the case above, everything returns 49.2.
Can anyone explain this construct? I've searched online and found nothing.
Thanks in advance for any help!
H100