in reply to getting array of values from hash
Is there some better way that will do the job?
Yes there is, it's called a hash slice. In general:
@values = @hash{@keys}; [download]
so for your example
@a2 = @h1{@a1}; [download]