http://www.perlmonks.org?node_id=351769


in reply to Hash table issue

From the looks of your code, you have a hash %info, which contains only one key "EmpNum" and the value associated with that key is a reference to an anonymous array. At no point in time do I see you populating the elements of your anonymous array, but instead I see you passing a reference to $info{EmpNum}[$x] where $x is some index value you increment.

Is there even such an element $info{EmpNum}[1]?

Nor do I see you creating any other keys to this hash %info except for "EmpNum". So I don't see what array you are iterating through when you do your foreach loop or what you are printing out.