in reply to Open file, sort data on matching field, close file

employee_id 227 appears to be reused, which is odd, so you can't use that feld.

What do you want to sort on? That would indicate how to store the data when you load it.

In any event, use a hash keyed on whatever field you decide, and use the Perl sorted keys idiom when you loop through the structure.