Thankyou dearly. I spent way too much time trying to figure that out!
Also why is it that
%hash=(0=>A) must be followed by $hash{1}=B ( for next key value pair you set I mean. )
rather than using the first format twice? I can't find this anywhere in the camel book or online.
Both these operations operate on the whole hash, initializing it with the data on the right side of the equation. The equation sign "=" means literally "the left side is made equal to the right side", not "the right side is added to or combined with the left side". So after the second equation any previous values in the hash will be lost
While when you use $hash{1}=B you only manipulate one value inside the hash, leaving the rest of the hash unchanged.
Thankyou dearly. I spent way too much time trying to figure that out! Also why is it that %hash=(0=>A) must be followed by $hash{1}=B ( for next key value pair you set I mean. ) rather than using the first format twice? I can't find this anywhere in the camel book or online.