in reply to Hash table issue
I don't know Tk all that well but I assume that -textvariable expects to be given a reference to where it will eventually store the value from that widget. As written, it will store these in successvie elements of @{$info{EmpNum}}. I'm going to assume you have some valid reason for creating this array as a reference value in a hash with no other keys, rather than an ordinary array.
However, your foreach loop doesn't look right. What you are iterating over are the elements of the array, @{$info{EmpNum}} yet you are treating each of these as if it is a key in %info that in turn returns an array of four elements. If true, then I have to assume this happens somewhere else, because your first block of code doesn't create anything like that. In any case you have a typo. $info{$_}>[0] should be $info{$_}->[0] or simply $info{$_}[0].
Update: I didn't fully read the thread above before posting. You can certainly do:
foreach (keys %info) { print "\t$info{$_}->[0]\t$info{$_}->[1]\t$info{$_}->[2]\t$info{$_} +->[3]\n"; }
Note the change from what you posted (%info instead of %info{EmpNum}). But again, given the code you posted, this will print only one row, because the only key in %info is 'EmpNum'
|
|---|