What do i expect to see - When the hash ref is added as an element to the array whose key is "optional" , the elements $VAR1->{'optional'}2, $VAR1->{'optional'}2 also get added to the array. I do not understand why.
i have tried to debug the code with a whole lot of print statements , but still not managed to find out why the extra elements are added.