You still have the problem you asked about the other day (in addition to the problems mentioned above -- $_ is never going to match
/^PER\s*$/). Your PER and EMP tags are on
separate lines from the other data so you need to read the data in separately. Check out the answers you got last time you posted and you will be able to fix it.
Check out Data::Dumper if you are really stuck.
HTH, --traveler