I wrote a perl script that does the following things.
1) Inputfile is provided
2) split input file using \n
3) if a line starts with "EMP" string then split the line with "|" and get the first word which is EMP ID
4) there might be multiple lines that starts with EMP so get all EMP ID's and out put those to a txt file
I wrote the below script but this one is not working not sure where did I made the mistake.