in reply to assigning value of a key in a hash to a variable while dereferencing

You are attempting to use rule 2 from the section "Using References" in Using_References". Your only mistake was using a '%' rather than '$' as the sigel. The advantage of this rule is that it always works. There are no exceptions or special cases. All the other rules produce code which is usually easier to write and certainly easier to read, but only when they apply. Other responders have already shown you how to take advantage of this in your case.
Bill
  • Comment on Re: assigning value of a key in a hash to a variable while dereferencing