I'm trying to work with hash tables in perl. I'm facing a problem when i'm using an array index as a key in the hash table.
my @array;
my %Mappings;
$Mappings{$array[0]} = 'First';
$Mappings{$array[1]} = 'Second';
print "$Mappings{$array[0]} \n $Mappings{$array[1]} \n";
The output of this code is always Second. I'm unable to access the value First with this code.
Should I be considering any other steps to access the value First ?